public Host(IEnumerable <IHandler> handlers, int port) { var resourceHandler = new EmbeddedResourceHandler(handlers.Select(x => x.GetType().Assembly)); var resourceIndex = new EmbeddedResourceHandlerIndex(resourceHandler); var defaultHandlers = new IHandler[] { resourceHandler, resourceIndex, new HomeHandler(handlers.OfType <IModule>().Concat(new[] { resourceIndex })), new DefaultFallbackHandler() }; _handlers = handlers.Concat(defaultHandlers); _port = port; }
public EmbeddedResourceHandlerIndex(EmbeddedResourceHandler resourceHandler) { _resourceHandler = resourceHandler; }