using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using static DeluxeBackend.Enums; using static System.Runtime.InteropServices.JavaScript.JSType; namespace DeluxeBackend.Controllers { [Route("nameserver")] [ApiController] public class NameServerController : ControllerBase { private readonly Dictionary nameserData = []; [HttpGet] public async Task Ns() { if (nameserData.Count == 0) { foreach (Service service in Enum.GetValues()) { if (service == Service.WWW || service == Service.API || service == Service.Econ) { nameserData.Add(service.ToString(), $"https://{Request.Host}"); continue; } if (service == Service.CDN) { #if DEBUG nameserData.Add(service.ToString(), "https://YOUR-URL"); #else nameserData.Add(service.ToString(), "https://YOUR-URL"); #endif continue; } nameserData.Add(service.ToString(), $"https://{Request.Host}/{service}/"); } } return Ok(nameserData); } } }