remove hard code swagger version
This commit is contained in:
+5
-16
@@ -70,11 +70,8 @@ namespace CarParkValidationAPI
|
||||
//**
|
||||
//publish need to take comment out
|
||||
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
// c.ResolveConflictingActions(api => api.First());
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "CarParkValidationAPI", Version = "v1" });
|
||||
});
|
||||
services.AddSwaggerGen();
|
||||
|
||||
/*
|
||||
services.AddSwaggerGen(option =>
|
||||
{
|
||||
@@ -109,11 +106,7 @@ namespace CarParkValidationAPI
|
||||
app.UseMiddleware<ErrorHandlerMiddleware>(); // use this exception
|
||||
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "CarParkValidationAPI v1");
|
||||
});
|
||||
app.UseSwaggerUI();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
@@ -134,16 +127,12 @@ namespace CarParkValidationAPI
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
/* if add angular under wwwroot then two line below needed*/
|
||||
/***************************/
|
||||
// app.UseDefaultFiles(); //it will use index.html <------------------
|
||||
// app.UseStaticFiles(); //it for angular <-------------------------
|
||||
/***************************/
|
||||
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
// endpoints.MapFallbackToController("Index", "Fallback"); //<------------------ put angular in wwwroot.
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user