Skip to content

Commit

Permalink
[APIGateway] Added Ocelot
Browse files Browse the repository at this point in the history
  • Loading branch information
hidayatarg committed Oct 7, 2023
1 parent 953b663 commit ba66e2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ApiGateways/OcelotApiGw/OcelotApiGw.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ocelot" Version="20.0.0" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/ApiGateways/OcelotApiGw/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
using Ocelot.DependencyInjection;
using Ocelot.Middleware;

var builder = WebApplication.CreateBuilder(args);

// logging configuration
builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging"));
builder.Logging.AddConsole();
builder.Logging.AddDebug();

builder.Services.AddOcelot();

var app = builder.Build();

app.UseOcelot().Wait();

app.MapGet("/", () => "Hello World!");

app.Run();

0 comments on commit ba66e2b

Please sign in to comment.