first commit

This commit is contained in:
2026-06-03 18:31:41 +03:30
commit 01f87cc461
71 changed files with 10802 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using backend.Models;
namespace backend.Controllers;
[ApiController]
[Route("api/[controller]")]
public class ConfigController : ControllerBase
{
private readonly AppConfig _appConfig;
public ConfigController(IOptions<AppConfig> appConfig)
{
_appConfig = appConfig.Value;
}
[HttpGet]
public IActionResult GetConfig()
{
return Ok(new
{
siteTitle = _appConfig.SiteTitle,
subtitle = _appConfig.Subtitle,
channels = _appConfig.Channels.Select(c => new { name = c.Name, url = c.Url }),
shortText = _appConfig.ShortText,
quizParticipationPoints = _appConfig.Quiz.ParticipationPoints,
quizCorrectAnswerPoints = _appConfig.Quiz.CorrectAnswerPoints
});
}
}