Exemple #1
0
 public object Any(FallbackRequest request)
 {
     return(new {
         Hello = "ServiceStack",
         Path = "/" + (request.PathInfo ?? "")
     });
 }
Exemple #2
0
        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");
 }
Exemple #4
0
        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);
        }
Exemple #5
0
 public object Any(FallbackRequest request)
 {
     OrderOfOperations.Add(typeof(FallbackService), "Any(FallbackRequest)");
     return(OrderOfOperations.GetOperations());
 }
Exemple #6
0
 public object Any(FallbackRequest request)
 {
     return(HttpError.NotFound("Not Found"));
 }