Example #1
0
        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));
        }
Example #2
0
        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));
        }