Esempio n. 1
0
 internal ErrorPages(Published published)
 {
     _published = published;
     _map       = new Dictionary <HttpStatusCode, PagePublished>();
     _defaults  = new Dictionary <HttpStatusCode, PagePublished>
     {
         { HttpStatusCode.NotFound, new PagePublished(DefaultNotFound, HttpStatusCode.NotFound) },
         { HttpStatusCode.InternalServerError, new PagePublished(DefaultServerError, HttpStatusCode.InternalServerError) }
     };
 }
Esempio n. 2
0
        internal void PublishErrorPage()
        {
            const string address = ServerLauncher.ErrorAddress;
            var          page    = new PagePublished(DefaultServerError, HttpStatusCode.InternalServerError);

            _published.Publish(address, page);
            var combined = Published.CombinePathMethod(address, "POST");

            _published.Publish(combined, page);
        }
Esempio n. 3
0
        internal override async Task <bool> ProcessRequest(HttpContext http)
        {
            var combined = Published.CombinePathMethod(http.Request.Path, http.Request.Method);

            if (!_app.TryGetNode(combined, out var item))
            {
                return(false);
            }
            await item.Run(_app, http, _options);

            return(true);
        }
Esempio n. 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Application()
 {
     _published = new Published();
     ErrorPages = new ErrorPages(_published);
     ErrorPages.PublishErrorImage();
     PublishService(new WebServiceContent
     {
         Address     = AutocompleteService.Address,
         ContentType = "application/json",
         Method      = "POST",
         Factory     = () => new AutocompleteService()
     });
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Application()
 {
     _published = new Published();
     ErrorPages = new ErrorPages(_published);
     ErrorPages.PublishErrorImage();
 }