@@ -28,18 +28,14 @@ public Startup(IConfiguration configuration)
28
28
public void ConfigureServices ( IServiceCollection services )
29
29
{
30
30
services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_1 ) ;
31
-
32
- // Register the Swagger generator, defining 1 or more Swagger documents
33
- services . AddSwaggerGen ( c =>
34
- {
35
- c . SwaggerDoc ( "v1" , new Info { Title = "My API" , Version = "v1" } ) ;
36
- } ) ;
37
-
31
+
38
32
services . AddWorkflow ( cfg =>
39
33
{
40
34
cfg . UseMongoDB ( @"mongodb://mongo:27017" , "workflow" ) ;
41
35
cfg . UseElasticsearch ( new ConnectionSettings ( new Uri ( "http://elastic:9200" ) ) , "workflows" ) ;
42
36
} ) ;
37
+
38
+ services . AddSwaggerGen ( c => c . SwaggerDoc ( "v1" , new Info { Title = "My API" , Version = "v1" } ) ) ;
43
39
}
44
40
45
41
public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
@@ -48,16 +44,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
48
44
{
49
45
app . UseDeveloperExceptionPage ( ) ;
50
46
}
51
-
52
- // Enable middleware to serve generated Swagger as a JSON endpoint.
53
- app . UseSwagger ( ) ;
54
-
55
- // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
56
- // specifying the Swagger JSON endpoint.
57
- app . UseSwaggerUI ( c =>
58
- {
59
- c . SwaggerEndpoint ( "/swagger/v1/swagger.json" , "My API V1" ) ;
60
- } ) ;
47
+
48
+ app . UseSwagger ( ) ;
49
+ app . UseSwaggerUI ( c => c . SwaggerEndpoint ( "/swagger/v1/swagger.json" , "My API V1" ) ) ;
61
50
62
51
app . UseMvc ( ) ;
63
52
0 commit comments