Files
react-dotnet-framework/backend/Gateway/GatewayApplicationBuilderExtensions.cs
2026-08-03 04:23:32 -04:00

15 lines
457 B
C#

namespace Backend.Gateway;
public static class GatewayApplicationBuilderExtensions
{
// CORS must run before the rate limiter so that rejected requests still carry
// the headers the browser needs to surface a 429 to the client.
public static IApplicationBuilder UseApiGateway(this IApplicationBuilder app)
{
app.UseCors(GatewayServiceCollectionExtensions.CorsPolicyName);
app.UseRateLimiter();
return app;
}
}