Aller au contenu

« Scalar » : différence entre les versions

De Banane Atomic
Ligne 20 : Ligne 20 :
     "http": {
     "http": {
       "launchBrowser": true,
       "launchBrowser": true,
      "launchUrl": "http://localhost:xxxx/scalar",
     }
     }
   }
   }
}
}
</filebox>
</filebox>

Version du 18 janvier 2025 à 12:37

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:xxxx/scalar

Properties/launchSettings.json
{
  "profiles": {
    "http": {
      "launchBrowser": true,
      "launchUrl": "http://localhost:xxxx/scalar",
    }
  }
}