Пример #1
0
        public Router(Server server)
        {
            this.server = server;
            routes = new List<BasicWebServer.Route>();

            extFolderMap = new Dictionary<string, ExtensionInfo>()
            {
                {"ico", new ExtensionInfo() {Loader=ImageLoader, ContentType="image/ico"}},
                {"png", new ExtensionInfo() {Loader=ImageLoader, ContentType="image/png"}},
                {"jpg", new ExtensionInfo() {Loader=ImageLoader, ContentType="image/jpg"}},
                {"gif", new ExtensionInfo() {Loader=ImageLoader, ContentType="image/gif"}},
                {"bmp", new ExtensionInfo() {Loader=ImageLoader, ContentType="image/bmp"}},
                {"html", new ExtensionInfo() {Loader=PageLoader, ContentType="text/html"}},
                {"css", new ExtensionInfo() {Loader=FileLoader, ContentType="text/css"}},
                {"js", new ExtensionInfo() {Loader=FileLoader, ContentType="text/javascript"}},
                {"json", new ExtensionInfo() {Loader=FileLoader, ContentType="text/json"}},
                {"", new ExtensionInfo() {Loader=PageLoader, ContentType="text/html"}},	  // no extension is assumed to be .html
            };
        }
Пример #2
0
 public AnonymousRouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler = null)
     : base(server, handler)
 {
 }
Пример #3
0
 public AuthenticatedExpirableRouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler = null)
     : base(server, handler)
 {
 }
Пример #4
0
 public RouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler)
 {
     this.server = server;
     this.handler = handler;
 }