diff --git a/src/api/Program.cs b/src/api/Program.cs index e51fecba..f99e09c6 100644 --- a/src/api/Program.cs +++ b/src/api/Program.cs @@ -32,19 +32,19 @@ policy.AllowAnyMethod(); }); -// Swagger UI -app.UseSwaggerUI(options => -{ - options.SwaggerEndpoint("./openapi.yaml", "v1"); - options.RoutePrefix = ""; -}); - +// This must come BEFORE UseSwaggerUI app.UseStaticFiles(new StaticFileOptions { // Serve openapi.yaml file ServeUnknownFileTypes = true, }); +// Swagger UI +app.UseSwaggerUI(options => +{ + options.SwaggerEndpoint("./openapi.yaml", "v1"); + options.RoutePrefix = ""; +}); app.MapGroup("/lists") .MapTodoApi()