Replace api with controller instead of minimalapi
This commit is contained in:
@@ -1,22 +1,26 @@
|
||||
using Emergence.api.Extensions;
|
||||
using Emergence.services.Extensions;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddEmergenceServices();
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
||||
builder.Services.AddOpenApi();
|
||||
builder.Services.AddServices();
|
||||
builder.Services.AddEndpoints(typeof(Program).Assembly);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.MapEndpoints();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.MapOpenApi("/openapi/emergence.yaml");
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user