dot-net/Program.cs

29 lines
648 B
C#
Raw Normal View History

2025-01-11 21:29:43 +00:00
using Scalar.AspNetCore;
2025-01-11 21:20:05 +00:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
2025-01-11 21:29:43 +00:00
app.UseSwagger(options =>
{
options.RouteTemplate = "openapi/{documentName}.json";
});
app.MapScalarApiReference();
2025-01-11 21:20:05 +00:00
}
app.UseAuthorization();
app.MapControllers();
app.Run();