Implement refresh autodiscover

This commit is contained in:
Zaprit 2025-05-26 23:12:12 +01:00
commit 91e10d2dab
4 changed files with 48 additions and 1 deletions

View file

@ -0,0 +1,26 @@
using LBPUnion.ProjectLighthouse.Configuration;
using LBPUnion.ProjectLighthouse.Servers.Website.Types;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers;
[ApiController]
public class AutoDiscoverController: ControllerBase
{
[ResponseCache(Duration = 86400)]
[HttpGet("/autodiscover")]
[Produces("application/json")]
public IActionResult AutoDiscover()
{
AutoDiscoverResponse resp = new()
{
Version = 3,
Url = ServerConfiguration.Instance.GameApiExternalUrl,
ServerBrand = ServerConfiguration.Instance.Customization.ServerName,
UsesCustomDigestKey = false,
BannerImageUrl = null,
ServerDescription = ServerConfiguration.Instance.Customization.ServerDescription,
};
return this.Ok(resp);
}
}