« Scalar » : différence entre les versions
Apparence
Balise : Révocation manuelle |
|||
Ligne 4 : | Ligne 4 : | ||
* [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/using-openapi-documents?view=aspnetcore-9.0#use-scalar-for-interactive-api-documentation Use Scalar for interactive API documentation] | * [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/using-openapi-documents?view=aspnetcore-9.0#use-scalar-for-interactive-api-documentation Use Scalar for interactive API documentation] | ||
= [https:// | = [https://guides.scalar.com/scalar/scalar-api-references/net-integration ASP.NET Core 9 integration] = | ||
<kode lang='ps'> | <kode lang='ps'> | ||
dotnet add package Scalar.AspNetCore | dotnet add package Scalar.AspNetCore |
Version du 3 avril 2025 à 09:31
Links
ASP.NET Core 9 integration
dotnet add package Scalar.AspNetCore |
Program.cs |
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
// add the following lines
app.MapScalarApiReference(options =>
{
options
.WithDefaultOpenAllTags(true)
.WithTheme(ScalarTheme.Solarized);
});
}
|
URL: http://localhost:5000/scalar
Properties/launchSettings.json |
{
"profiles": {
"http": {
"launchBrowser": true,
"launchUrl": "http://localhost:5000/scalar",
"applicationUrl": "http://localhost:5000"
}
}
}
|