mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
Implement chat rendering and message handling with colored segments
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using EchoHub.Core.DTOs;
|
||||
using EchoHub.Server.Data;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace EchoHub.Server.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/server")]
|
||||
public class ServerController(EchoHubDbContext db, IConfiguration config) : ControllerBase
|
||||
{
|
||||
[HttpGet("info")]
|
||||
public async Task<IActionResult> GetInfo()
|
||||
{
|
||||
var userCount = await db.Users.CountAsync();
|
||||
var channelCount = await db.Channels.CountAsync();
|
||||
|
||||
var status = new ServerStatusDto(
|
||||
config["Server:Name"] ?? "EchoHub Server",
|
||||
config["Server:Description"],
|
||||
userCount,
|
||||
channelCount);
|
||||
|
||||
return Ok(status);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user