コード例 #1
0
 public SigSpecUIIndexMiddleware(RequestDelegate nextDelegate, string indexPath, SigSpecUiSettings settings, string resourcePath)
 {
     _nextDelegate = nextDelegate;
     _indexPath    = indexPath;
     _settings     = settings;
     _resourcePath = resourcePath;
 }
コード例 #2
0
        public static IApplicationBuilder UseSigSpecUi(this IApplicationBuilder app, Action <SigSpecUiSettings> configure = null)
        {
            var settings = new SigSpecUiSettings();

            configure?.Invoke(settings);

            // TODO: Redirect /sigspec to /sigspec/index.html
            // TODO: Inject URLs and document names from registered documents into index.html => and then JS

            app.UseFileServer(new FileServerOptions
            {
                RequestPath  = new PathString(settings.Route),
                FileProvider = new EmbeddedFileProvider(typeof(SigSpecApplicationBuilderExtensions).GetTypeInfo().Assembly, "SigSpec.AspNetCore.SigSpecUi")
            });

            return(app);
        }