aspnet-template/Program.cs

23 lines
496 B
C#
Raw Permalink Normal View History

2025-01-24 12:31:01 +00:00
using Scalar.AspNetCore;
2025-01-24 11:27:32 +00:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
2025-01-24 12:31:01 +00:00
2025-01-24 11:27:32 +00:00
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
2025-01-24 12:31:01 +00:00
app.MapScalarApiReference();
2025-01-24 11:27:32 +00:00
}
app.UseAuthorization();
app.MapControllers();
app.Run();