public ContentFolder(string path, string prefix, Func <IHttpContext, Task> handler) { Logger = DefaultLogger.GetInstance <IContentFolder>(); FolderPath = path; Prefix = prefix; FileNotFoundHandler = handler ?? DefaultFileNotFoundHandler; }
public RestServer(IRouter router, IRouteScanner scanner, ILogger <IRestServer> logger) { if (!HttpListener.IsSupported) { throw new PlatformNotSupportedException("Windows Server 2003 (or higher) or Windows XP SP2 (or higher) is required to use instances of this class."); } Router = router ?? new Router(DefaultLogger.GetInstance <IRouter>()); RouteScanner = scanner ?? new RouteScanner(DefaultLogger.GetInstance <IRouteScanner>()); Logger = logger ?? DefaultLogger.GetInstance <IRestServer>(); RouteScanner.Services = Router.Services; Listener = new HttpListener(); RequestHandler = new Thread(RequestListenerAsync); }
public RouteScanner(ILogger <IRouteScanner> logger) { Logger = logger ?? DefaultLogger.GetInstance <IRouteScanner>(); }