using FastEndpoints;

namespace SpaceGame.Api.Universe.Api;

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;
    }
}
