From ce8ab1cf368048c7cc010bf18a20303ab04e9d2e Mon Sep 17 00:00:00 2001 From: Nestisse Date: Fri, 29 Mar 2024 13:51:32 +0100 Subject: [PATCH] Ajout de settings pour swagger --- API_SQLuedo/API/Program.cs | 11 +++++++++-- API_SQLuedo/API/Properties/launchSettings.json | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/API_SQLuedo/API/Program.cs b/API_SQLuedo/API/Program.cs index f4e19f8..0c518d1 100644 --- a/API_SQLuedo/API/Program.cs +++ b/API_SQLuedo/API/Program.cs @@ -116,8 +116,15 @@ using (var scope = app.Services.CreateScope()) } -app.UseSwagger(); -app.UseSwaggerUI(); +app.UseSwagger(options => +{ + options.RouteTemplate = "containers/johnnyratton-sqluedo-api/{documentName}/swagger.json"; +}); +app.UseSwaggerUI(option => +{ + option.SwaggerEndpoint("/containers/johnnyratton-sqluedo-api/swagger/v1/swagger.json", "Demo API v1"); + option.RoutePrefix = "containers/johnnyratton-sqluedo-api"; +}); app.UseHttpsRedirection(); diff --git a/API_SQLuedo/API/Properties/launchSettings.json b/API_SQLuedo/API/Properties/launchSettings.json index 63ba7b8..02e776b 100644 --- a/API_SQLuedo/API/Properties/launchSettings.json +++ b/API_SQLuedo/API/Properties/launchSettings.json @@ -13,7 +13,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "containers/johnnyratton-sqluedo-api", "applicationUrl": "http://localhost:5015", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -23,7 +23,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "containers/johnnyratton-sqluedo-api", "applicationUrl": "https://localhost:7259;http://localhost:5015", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -32,7 +32,7 @@ "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "containers/johnnyratton-sqluedo-api", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }