Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ApiGateway/ApiGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
<PackageReference Include="Yarp.ReverseProxy" Version="2.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/ApiGateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ EXPOSE 5000
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["ApiGateway/ApiGateway.csproj", "ApiGateway/"]
COPY ["Shared/Shared.Contracts/Shared.Contracts.csproj", "Shared/Shared.Contracts/"]
COPY ["Shared/Shared.Infrastructure/Shared.Infrastructure.csproj", "Shared/Shared.Infrastructure/"]
RUN dotnet restore "ApiGateway/ApiGateway.csproj"
COPY ApiGateway/ ApiGateway/
COPY Shared/ Shared/
WORKDIR "/src/ApiGateway"
RUN dotnet build -c Release -o /app/build

Expand Down
3 changes: 3 additions & 0 deletions src/ApiGateway/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddReverseProxy()
Expand All @@ -7,6 +9,7 @@

var app = builder.Build();

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapReverseProxy();
app.MapHealthChecks("/healthz");

Expand Down
10 changes: 5 additions & 5 deletions src/ApiGateway/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
"identity-route": {
"ClusterId": "identity-cluster",
"Match": { "Path": "/api/identity/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/identity" }]
"Transforms": [{ "PathPattern": "/api/identity/{**catch-all}" }]
},
"customer-route": {
"ClusterId": "customer-cluster",
"Match": { "Path": "/api/customers/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/customers" }]
"Transforms": [{ "PathPattern": "/api/customer/{**catch-all}" }]
},
"order-route": {
"ClusterId": "order-cluster",
"Match": { "Path": "/api/orders/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/orders" }]
"Transforms": [{ "PathPattern": "/api/order/{**catch-all}" }]
},
"product-route": {
"ClusterId": "product-cluster",
"Match": { "Path": "/api/products/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/products" }]
"Transforms": [{ "PathPattern": "/api/product/{**catch-all}" }]
},
"notification-route": {
"ClusterId": "notification-cluster",
"Match": { "Path": "/api/notifications/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/notifications" }]
"Transforms": [{ "PathPattern": "/api/notification/{**catch-all}" }]
}
},
"Clusters": {
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Customer/Customer.API/Customer.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Customer.Domain\Customer.Domain.csproj" />
<ProjectReference Include="..\Customer.Infrastructure\Customer.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
8 changes: 8 additions & 0 deletions src/Services/Customer/Customer.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Customer.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -13,12 +14,19 @@

var app = builder.Build();

using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<CustomerDbContext>();
db.Database.EnsureCreated();
}

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapControllers();
app.MapHealthChecks("/healthz");

Expand Down
4 changes: 2 additions & 2 deletions src/Services/Identity/Identity.API/Identity.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Identity.Domain\Identity.Domain.csproj" />
<ProjectReference Include="..\Identity.Infrastructure\Identity.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
8 changes: 8 additions & 0 deletions src/Services/Identity/Identity.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Identity.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -13,12 +14,19 @@

var app = builder.Build();

using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<IdentityDbContext>();
db.Database.EnsureCreated();
}

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapControllers();
app.MapHealthChecks("/healthz");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Notification.Domain\Notification.Domain.csproj" />
<ProjectReference Include="..\Notification.Infrastructure\Notification.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
2 changes: 2 additions & 0 deletions src/Services/Notification/Notification.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Notification.Infrastructure.Data;
using Notification.Infrastructure.Repositories;
using Microsoft.EntityFrameworkCore;
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -32,6 +33,7 @@
app.UseSwaggerUI();
}

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapControllers();
app.MapHealthChecks("/healthz");

Expand Down
4 changes: 2 additions & 2 deletions src/Services/Order/Order.API/Order.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Order.Domain\Order.Domain.csproj" />
<ProjectReference Include="..\Order.Infrastructure\Order.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
8 changes: 8 additions & 0 deletions src/Services/Order/Order.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Order.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -13,12 +14,19 @@

var app = builder.Build();

using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<OrderDbContext>();
db.Database.EnsureCreated();
}

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapControllers();
app.MapHealthChecks("/healthz");

Expand Down
4 changes: 2 additions & 2 deletions src/Services/Product/Product.API/Product.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\Product.Domain\Product.Domain.csproj" />
<ProjectReference Include="..\Product.Infrastructure\Product.Infrastructure.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Contracts\Shared.Contracts.csproj" />
<ProjectReference Include="..\..\..\Shared\Shared.Infrastructure\Shared.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.*" />
Expand Down
8 changes: 8 additions & 0 deletions src/Services/Product/Product.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Product.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Shared.Infrastructure.Middleware;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -13,12 +14,19 @@

var app = builder.Build();

using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<ProductDbContext>();
db.Database.EnsureCreated();
}

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseMiddleware<CorrelationIdMiddleware>();
app.MapControllers();
app.MapHealthChecks("/healthz");

Expand Down