public SigSpecUIIndexMiddleware(RequestDelegate nextDelegate, string indexPath, SigSpecUiSettings settings, string resourcePath) { _nextDelegate = nextDelegate; _indexPath = indexPath; _settings = settings; _resourcePath = resourcePath; }
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); }