46 lines
1.0 KiB
C#
46 lines
1.0 KiB
C#
using Blog3000.Shared;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Caching.Memory;
|
|
using System.Text;
|
|
using System.IO;
|
|
using Microsoft.AspNetCore.StaticFiles;
|
|
using static Blog3000.Server.BlogEnv;
|
|
|
|
namespace Blog3000.Server.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("/config.json")]
|
|
public class ConfigController : ControllerBase
|
|
{
|
|
|
|
private readonly ILogger<BlogPostsController> logger;
|
|
private readonly BlogEnv config;
|
|
|
|
public ConfigController(ILogger<BlogPostsController> logger, BlogEnv config)
|
|
{
|
|
this.logger = logger;
|
|
this.config = config;
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
public ActionResult<ClientConfigJson> Get()
|
|
{
|
|
logger.LogInformation($"Config|{HttpContext.Connection.RemoteIpAddress}|Get");
|
|
|
|
var r= config.BlogConfig.ToClientConfig();
|
|
return r;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|