using Microsoft.AspNetCore.Builder; namespace BotSharp.OpenAPI; public static class BotSharpOpenApiExtensions { /// /// Use Swagger/OpenAPI /// /// /// /// public static IApplicationBuilder UseBotSharpOpenAPI(this IApplicationBuilder app, bool isDevelopment = false) { if (app == null) { throw new ArgumentNullException(nameof(app)); } app.UseSwagger(); if (isDevelopment) { app.UseSwaggerUI(); } return app; } /// /// Host BotSharp UI built in adapter-static /// /// /// /// public static IApplicationBuilder UseBotSharpUI(this IApplicationBuilder app, bool isDevelopment = false) { if (app == null) { throw new ArgumentNullException(nameof(app)); } // app.UseFileServer(); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseSpa(config => { if (isDevelopment) { config.UseProxyToSpaDevelopmentServer("http://localhost:5015"); } }); return app; } }