private Task ShowCSSPage(IHttpContext context, string cssMatch) { if (cssMatch.IsEmptyOrNull()) { } string text = HtmlBlockCreator.GetSaveTextFile(cssMatch); if (text.IsEmptyOrNull()) { return(ShowErrorPage(context, 404, "Not found")); } context.Response.StatusCode = 200; return(context.SendStringAsync(text, "text/css", Encoding.UTF8)); }
private Task ShowJSPage(IHttpContext context, string jsMatch) { if (jsMatch.IsEmptyOrNull()) { return(ShowErrorPage(context, 404, "Not found")); } string text = HtmlBlockCreator.GetSaveTextFile(jsMatch); if (text.IsEmptyOrNull()) { return(ShowErrorPage(context, 404, "Not found")); } context.Response.StatusCode = 200; return(context.SendStringAsync(text, "application/javascript", Encoding.UTF8)); }
private Task ShowErrorPage(IHttpContext context, int error, string text) { context.Response.StatusCode = error; return(context.SendStringAsync(HtmlBlockCreator.CreateSimpleHtmlPage(text, "WebStyles"), "text/html", Encoding.UTF8)); }