mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-05 21:37:55 +00:00
feat(api): separate private endpoints from public API versioning
This commit is contained in:
parent
eb4f53c69e
commit
9f7c47b78e
3 changed files with 35 additions and 59 deletions
|
|
@ -1,34 +0,0 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PluralKit.Core;
|
||||
|
||||
namespace PluralKit.API;
|
||||
|
||||
[ApiController]
|
||||
[Route("v1")]
|
||||
public class MetaController: ControllerBase
|
||||
{
|
||||
private readonly IDatabase _db;
|
||||
private readonly ModelRepository _repo;
|
||||
|
||||
public MetaController(IDatabase db, ModelRepository repo)
|
||||
{
|
||||
_db = db;
|
||||
_repo = repo;
|
||||
}
|
||||
|
||||
[HttpGet("meta")]
|
||||
public async Task<ActionResult<JObject>> GetMeta()
|
||||
{
|
||||
await using var conn = await _db.Obtain();
|
||||
var shards = await _repo.GetShards();
|
||||
|
||||
var o = new JObject();
|
||||
o.Add("shards", shards.ToJSON());
|
||||
o.Add("version", BuildInfoService.Version);
|
||||
|
||||
return Ok(o);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue