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) } }; }
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); }
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); }
/// <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() }); }
/// <summary> /// Constructor /// </summary> public Application() { _published = new Published(); ErrorPages = new ErrorPages(_published); ErrorPages.PublishErrorImage(); }