Example #1
0
        public static Task RobotsRoute(IDictionary<string, object> env)
        {
            IResponse response = new ResponseWrapper(env);

            response.ContentType = "text/plain";
            response.Write("User-agent: *\nDisallow: /");

            return TaskHelpers.Completed();
        }
Example #2
0
        public static Task IndexRoute(IDictionary<string, object> env)
        {
            IResponse response = new ResponseWrapper(env);

            response.StatusCode = 200;
            response.Write("<html>" +
                               "<head>" +
                                   "<title>JibbR</title>" +
                               "</head>" +
                               "<body>hi.</body>" +
                           "</html>");

            return TaskHelpers.Completed();
        }
Example #3
0
        public static Task AdapterRoutes(IRouteManager routeManager, IDictionary<string, object> env)
        {
            // we wrap these simply to remove the owin & gate dependencies elsewhere
            // but maybe we won't need it...for now I kind of like it
            IRequest request = new RequestWrapper(env);
            IResponse response = new ResponseWrapper(env);

            var result = routeManager.HandleRoute(request, response);
            if (!result)
            {
                response.Status = "404 Route Not Found";
            }

            return TaskHelpers.Completed();
        }