using EnvelopeGenerator.GeneratorAPI.Models.Annotation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; namespace EnvelopeGenerator.GeneratorAPI.Controllers; /// /// Exposes configuration data required by the client applications. /// /// /// Initializes a new instance of . /// [Route("api/[controller]")] [ApiController] [Authorize] public class ConfigController(IOptionsMonitor annotationParamsOptions) : ControllerBase { private readonly AnnotationParams _annotationParams = annotationParamsOptions.CurrentValue; /// /// Returns annotation configuration that was previously rendered by MVC. /// [HttpGet("Annotations")] public IActionResult GetAnnotationParams() { return Ok(_annotationParams.AnnotationJSObject); } }