Add server configuration service and repo

This commit is contained in:
Holden
2026-06-18 13:43:59 -05:00
parent 7fc7e1dc91
commit 608def3ac8
15 changed files with 272 additions and 9 deletions

View File

@@ -1,13 +1,17 @@
using Microsoft.AspNetCore.Mvc;
using RecNet.Application.Services.Configuration;
namespace API.Controllers.Config.V1;
[Route("api/[controller]/v1")]
[ApiController]
public class ConfigController : ControllerBase
public class ConfigController(IConfigService configService) : ControllerBase
{
// TODO: Resolve from Database
[HttpGet("motd")]
public ActionResult<string> GetMotd()
=> Ok("Hello World!");
public async Task<ActionResult<string>> GetMotd(CancellationToken ct = default)
{
var motd = await configService.GetAsync("Config:MOTD", "Ten Whole Years!", ct);
return Ok(motd);
}
}