« Scalar » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
Ligne 14 : | Ligne 14 : | ||
} | } | ||
</filebox> | </filebox> | ||
URL: {{boxx|http://localhost: | URL: {{boxx|http://localhost:5000/scalar}} | ||
<filebox fn='Properties/launchSettings.json'> | <filebox fn='Properties/launchSettings.json'> | ||
{ | { | ||
Ligne 20 : | Ligne 20 : | ||
"http": { | "http": { | ||
"launchBrowser": true, | "launchBrowser": true, | ||
"launchUrl": "http://localhost: | "launchUrl": "http://localhost:5000/scalar", | ||
"applicationUrl": "http://localhost:5000" | |||
} | } | ||
} | } | ||
} | } | ||
</filebox> | </filebox> |
Version du 18 janvier 2025 à 12:47
ASP.NET Core 9 integration
dotnet add package Scalar.AspNetCore |
Program.cs |
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference(); // add this line
}
|
URL: http://localhost:5000/scalar
Properties/launchSettings.json |
{
"profiles": {
"http": {
"launchBrowser": true,
"launchUrl": "http://localhost:5000/scalar",
"applicationUrl": "http://localhost:5000"
}
}
}
|