示例#1
0
 public SwaggerUIMiddleware(
     RequestDelegate next,
     IHostingEnvironment hostingEnv,
     ILoggerFactory loggerFactory,
     SwaggerUIOptions options)
 {
     _options = options ?? new SwaggerUIOptions();
     _staticFileMiddleware      = CreateStaticFileMiddleware(next, hostingEnv, loggerFactory, options);
     _swaggerUIIndexHtmlBuilder = new SwaggerUIIndexHtmlBuilder(_options);
 }
示例#2
0
        public virtual IActionResult Get()
        {
            var options = GetSwaggerUIOptions();

            var builder = new SwaggerUIIndexHtmlBuilder(options);

            var result = builder.Build();

            return(Content(result, "text/html"));
        }