Projektdateien hinzufügen.
This commit is contained in:
parent
72ecb03642
commit
76fbb232a7
48 changed files with 3779 additions and 0 deletions
21
Controllers/ErrorController.cs
Normal file
21
Controllers/ErrorController.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue