using FastEndpoints;

namespace SpaceGame.Api.Universe.Api;

public sealed class GetWorldHandler(WorldService worldService) : EndpointWithoutRequest
{
    public override void Configure()
    {
        Get("/api/world");
        AllowAnonymous();
    }

    public override Task HandleAsync(CancellationToken cancellationToken) =>
      SendOkAsync(worldService.GetSnapshot(), cancellationToken);
}
