-
-
Notifications
You must be signed in to change notification settings - Fork 541
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (24 loc) · 619 Bytes
/
Program.cs
File metadata and controls
29 lines (24 loc) · 619 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using ECommerce.Domain;
using Microsoft.OpenApi;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddRouting()
.AddECommerce()
.AddEndpointsApiExplorer()
.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "ECommerce", Version = "V1" });
});
var app = builder.Build();
app.UseRouting()
.UseEndpoints(endpoints =>
{
endpoints.UseECommerceEndpoints();
})
.UseSwagger()
.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "ECommerce V1");
c.RoutePrefix = string.Empty;
});
app.Run();