File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed
src/Clean.Architecture.Web/Configurations Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,24 @@ public static async Task<IApplicationBuilder> UseAppMiddlewareAndSeedDatabase(th
2121
2222 app . UseFastEndpoints ( ) ;
2323
24- app . UseSwaggerGen ( options =>
25- {
26- options . Path = "/openapi/{documentName}.json" ;
27- } ,
28- settings =>
29- {
30- settings . Path = "/swagger" ;
31- settings . DocumentPath = "/openapi/{documentName}.json" ;
32- } ) ;
33-
34- app . MapScalarApiReference ( options =>
24+ if ( app . Environment . IsDevelopment ( ) )
3525 {
36- options . WithTitle ( "Clean Architecture API" ) ;
37- options . WithOpenApiRoutePattern ( "/openapi/{documentName}.json" ) ;
38- } ) ;
26+ app . UseSwaggerGen ( options =>
27+ {
28+ options . Path = "/openapi/{documentName}.json" ;
29+ } ,
30+ settings =>
31+ {
32+ settings . Path = "/swagger" ;
33+ settings . DocumentPath = "/openapi/{documentName}.json" ;
34+ } ) ;
35+
36+ app . MapScalarApiReference ( options =>
37+ {
38+ options . WithTitle ( "Clean Architecture API" ) ;
39+ options . WithOpenApiRoutePattern ( "/openapi/{documentName}.json" ) ;
40+ } ) ;
41+ }
3942
4043 app . UseHttpsRedirection ( ) ; // Note this will drop Authorization headers
4144
You can’t perform that action at this time.
0 commit comments