Add remaining project files
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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<string, string> nameserData = [];
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Ns()
|
||||
{
|
||||
if (nameserData.Count == 0)
|
||||
{
|
||||
foreach (Service service in Enum.GetValues<Service>())
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user