Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit f9c7e38

Browse files
Igor SychevIgor Sychev
authored andcommitted
We don't need swagger and MVC contollers in Payment API
1 parent 926cc9f commit f9c7e38

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

src/Services/Payment/Payment.API/Controllers/HomeController.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Services/Payment/Payment.API/Payment.API.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@
66
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
77
</PropertyGroup>
88

9-
<ItemGroup>
10-
<Folder Include="wwwroot\" />
11-
</ItemGroup>
129
<ItemGroup>
1310
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
1411
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
15-
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
1612
</ItemGroup>
1713
<ItemGroup>
1814
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />

src/Services/Payment/Payment.API/Startup.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public Startup(IConfiguration configuration)
3131
// This method gets called by the runtime. Use this method to add services to the container.
3232
public IServiceProvider ConfigureServices(IServiceCollection services)
3333
{
34-
// Add framework services.
35-
services.AddMvc();
3634

3735
services.Configure<PaymentSettings>(Configuration);
3836

@@ -79,18 +77,6 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
7977

8078
RegisterEventBus(services);
8179

82-
services.AddSwaggerGen(options =>
83-
{
84-
options.DescribeAllEnumsAsStrings();
85-
options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
86-
{
87-
Title = "eShopOnContainers - Payment HTTP API",
88-
Version = "v1",
89-
Description = "The Payment Microservice HTTP API. This is a Data-Driven/CRUD microservice sample",
90-
TermsOfService = "Terms Of Service"
91-
});
92-
});
93-
9480
var container = new ContainerBuilder();
9581
container.Populate(services);
9682
return new AutofacServiceProvider(container.Build());
@@ -105,14 +91,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
10591
app.UsePathBase(pathBase);
10692
}
10793

108-
app.UseMvcWithDefaultRoute();
109-
110-
app.UseSwagger()
111-
.UseSwaggerUI(c =>
112-
{
113-
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
114-
});
115-
11694
ConfigureEventBus(app);
11795
}
11896

0 commit comments

Comments
 (0)