This commit is contained in:
2025-09-12 11:50:04 +02:00
parent 6e6d17b134
commit 7def038cc9
21 changed files with 285 additions and 216 deletions

View File

@@ -0,0 +1,32 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Watcher.Data;
[Route("[controller]/v1")]
public class ApiController : Controller
{
private readonly AppDbContext _context;
private readonly ILogger<ApiController> _logger;
public ApiController(AppDbContext context, ILogger<ApiController> logger)
{
_context = context;
_logger = logger;
}
[HttpGet("reference")]
public IActionResult ApiReference()
{
return View();
}
[HttpGet("servers")]
public async Task<IActionResult> GetAllServers()
{
var Servers = await _context.Servers.OrderBy(s => s.Id).ToListAsync();
return Ok();
}
}