Swagger UI is not creating in a .net core application when deployed in azure but it is working perfectly in local
I have added this in
ConfigureServices(IServiceCollection services) methode in startup.cs
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info
{
Version = "v1",
Title = "API",
Description = "API"
});
});
and
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "API");
c.RoutePrefix = "swagger";
});
app.UseAuthentication();
env.ConfigureNLog("nlog.config");
loggerFactory.AddNLog();
app.UseSignalR(routes =>
{
routes.MapHub<DashboardHub>("/hubs/dashboard");
});
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action=Index}/{id?}");
});
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
in Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
c.RoutePrefix = string.empty
? - SWilko