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