Projektdateien hinzufügen.

This commit is contained in:
Kevin Kandlbinder 2024-06-21 13:11:34 +02:00
parent 72ecb03642
commit 76fbb232a7
48 changed files with 3779 additions and 0 deletions

View file

@ -0,0 +1,21 @@
using Microsoft.AspNetCore.Mvc;
namespace WebEMSim.Controllers
{
[ApiController]
[Route("error")]
public class ErrorController : ControllerBase
{
[HttpGet("{statusCode}", Name = "HandleError")]
public IActionResult Handle(int statusCode)
{
if (statusCode == 404)
{
var fallbackFile = Path.Combine(Environment.CurrentDirectory, "webem-ui/build/404.html");
return PhysicalFile(fallbackFile, "text/html");
}
return StatusCode(statusCode);
}
}
}