Initial QMAX production app
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using QMax.Api.Data;
|
||||
|
||||
namespace QMax.Api.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/status")]
|
||||
public sealed class StatusController(QMaxDbContext db) : ControllerBase
|
||||
{
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<object>> Get(CancellationToken cancellationToken)
|
||||
{
|
||||
return new
|
||||
{
|
||||
name = "QMAX Bridge",
|
||||
status = "ok",
|
||||
serverTime = DateTimeOffset.UtcNow,
|
||||
chats = await db.Chats.CountAsync(cancellationToken),
|
||||
messages = await db.Messages.CountAsync(cancellationToken)
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user