public Html5Middleware(AppFunc next, HTML5ServerOptions options)
        {
            _next = next;
            _options = options;

            _innerMiddleware = new StaticFileMiddleware(next, options.FileServerOptions.StaticFileOptions);
        }
Esempio n. 2
0
        public Html5Middleware(AppFunc next, HTML5ServerOptions options)
        {
            _next    = next;
            _options = options;

            _innerMiddleware = new StaticFileMiddleware(next, options.FileServerOptions.StaticFileOptions);
        }
        public static IAppBuilder UseHtml5Routing(this IAppBuilder builder, string rootPath, string entryPath)
        {
            var fileSystem = new PhysicalFileSystem(rootPath);
            var fileServerOptions = new FileServerOptions()
            {
                EnableDirectoryBrowsing = false,
                FileSystem = fileSystem
            };
            var options = new HTML5ServerOptions()
            {
                FileServerOptions = fileServerOptions,
                EntryPath = new PathString(entryPath)
            };

            builder.UseDefaultFiles(options.FileServerOptions.DefaultFilesOptions);

            return builder.Use(new Func<AppFunc, AppFunc>(next => new Html5Middleware(next, options).Invoke));
        }
Esempio n. 4
0
        public static IAppBuilder UseHtml5Routing(this IAppBuilder builder, string rootPath, string entryPath)
        {
            var fileSystem        = new PhysicalFileSystem(rootPath);
            var fileServerOptions = new FileServerOptions()
            {
                EnableDirectoryBrowsing = false,
                FileSystem = fileSystem
            };
            var options = new HTML5ServerOptions()
            {
                FileServerOptions = fileServerOptions,
                EntryPath         = new PathString(entryPath)
            };

            builder.UseDefaultFiles(options.FileServerOptions.DefaultFilesOptions);

            return(builder.Use(new Func <AppFunc, AppFunc>(next => new Html5Middleware(next, options).Invoke)));
        }