feat(backend): move endpoints to FastEndpoints handlers
This commit is contained in:
18
apps/backend/Handlers/RootRedirectHandler.cs
Normal file
18
apps/backend/Handlers/RootRedirectHandler.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using FastEndpoints;
|
||||
|
||||
namespace SpaceGame.Simulation.Api.Handlers;
|
||||
|
||||
public sealed class RootRedirectHandler : EndpointWithoutRequest
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override Task HandleAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
HttpContext.Response.Redirect("/api/world");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user