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 }; }
public AnonymousRouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler = null) : base(server, handler) { }
public AuthenticatedExpirableRouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler = null) : base(server, handler) { }
public RouteHandler(Server server, Func<Session, Dictionary<string, object>, ResponsePacket> handler) { this.server = server; this.handler = handler; }