diff --git a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj index 4518eb7e..7dca91d6 100644 --- a/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj +++ b/EnvelopeGenerator.GeneratorAPI/EnvelopeGenerator.GeneratorAPI.csproj @@ -1,15 +1,16 @@  - net8.0;net9.0 + net9.0 enable enable + - + diff --git a/EnvelopeGenerator.GeneratorAPI/Program.cs b/EnvelopeGenerator.GeneratorAPI/Program.cs index 0baaa1d2..35abd3f4 100644 --- a/EnvelopeGenerator.GeneratorAPI/Program.cs +++ b/EnvelopeGenerator.GeneratorAPI/Program.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Localization; using Microsoft.EntityFrameworkCore; using System.Globalization; +using Scalar.AspNetCore; var builder = WebApplication.CreateBuilder(args); @@ -32,7 +33,7 @@ builder.Services.AddCors(options => // Swagger builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); - +builder.Services.AddOpenApi(); // DbContext var connStr = config.GetConnectionString("Default") ?? throw new InvalidOperationException("There is no default connection string in appsettings.json."); builder.Services.AddDbContext(options => options.UseSqlServer(connStr)); @@ -66,11 +67,14 @@ builder.Services var app = builder.Build(); +app.MapOpenApi(); + // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); + app.MapScalarApiReference(); } // Set CORS policy