public object Any(FallbackRequest request) { return(new { Hello = "ServiceStack", Path = "/" + (request.PathInfo ?? "") }); }
public object Any(FallbackRequest request) { if (Request.ResponseContentType == MimeTypes.Html) { return(new HttpResult(IndexFile.Value)); } return(new { Path = request.Path }); }
public object Any(FallbackRequest request) { if (string.IsNullOrWhiteSpace(request.Path)) { var fi = new FileInfo(Path.Combine((AppHost.Instance as AppHost).RootDir, "wwwroot/index-page.html")); return(new HttpResult(fi)); } throw HttpError.NotFound("Not Found"); }
public async Task <object> Any(FallbackRequest request) { if (Request.ResponseContentType == MimeTypes.Html) { var tagsDir = (AppHost.Instance as AppHost).TagsDir; var rootDir = (AppHost.Instance as AppHost).RootDir; if (request.Path.EqualsIgnoreCase("ssr")) { var result = await NodeServices.InvokeAsync <string> ( Path.Combine(rootDir, "CompileTag.js"), Path.Combine(tagsDir, "todo.tag"), Gateway.Send(new TodosRequest())); return(new HttpResult(AppHost.ToDoHtml.Replace("<todo></todo>", result))); } else { return(new HttpResult(AppHost.ToDoHtml)); } } return(request); }
public object Any(FallbackRequest request) { OrderOfOperations.Add(typeof(FallbackService), "Any(FallbackRequest)"); return(OrderOfOperations.GetOperations()); }
public object Any(FallbackRequest request) { return(HttpError.NotFound("Not Found")); }