feat: landing page + logo, dev-mode banner + sync cap, non-blocking sync with progress splash
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Asp.Versioning;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace InboxIntel.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Public metadata the SPA reads on load to decide whether to show the dev
|
||||
/// banner. devMode falls back to the hosting environment when App:DevMode is
|
||||
/// unset, and can be forced on/off via the App:DevMode config / App__DevMode env.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/app")]
|
||||
public class AppInfoController : ControllerBase
|
||||
{
|
||||
private readonly IConfiguration _config;
|
||||
private readonly IWebHostEnvironment _env;
|
||||
|
||||
public AppInfoController(IConfiguration config, IWebHostEnvironment env)
|
||||
{
|
||||
_config = config;
|
||||
_env = env;
|
||||
}
|
||||
|
||||
[HttpGet("info")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult Info()
|
||||
{
|
||||
var devMode = _config.GetValue<bool?>("App:DevMode") ?? _env.IsDevelopment();
|
||||
return Ok(new
|
||||
{
|
||||
environment = _env.EnvironmentName,
|
||||
devMode,
|
||||
maxMessages = _config.GetValue<int>("GmailSync:MaxMessages")
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user