Created
April 6, 2025 07:54
-
-
Save iozcelik/494ac0263f4923552f68e45c8545d8a2 to your computer and use it in GitHub Desktop.
.NET 9 OpenApi using with FastEndpoints and Scalar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FastEndpoints; | |
using Scalar.AspNetCore; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddOpenApi(); | |
builder.Services.AddFastEndpoints() | |
.AddOpenApiDocument(); | |
var app = builder.Build(); | |
app.UseFastEndpoints() | |
.UseOpenApi(); | |
if (app.Environment.IsDevelopment()) | |
{ | |
app.MapOpenApi(); | |
app.MapScalarApiReference(); | |
} | |
app.UseHttpsRedirection(); | |
app.Run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment