mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
23 lines
647 B
C#
23 lines
647 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace API.Core.Controllers;
|
|
|
|
/// <summary>
|
|
/// Handles requests that do not match any other route, used as the application's fallback controller.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Wired up as the fallback target via <c>app.MapFallbackToController("Handle404", "NotFound")</c> in
|
|
/// <c>Program.cs</c>.
|
|
/// </remarks>
|
|
[ApiController]
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
[Route("error")] // required
|
|
public class NotFoundController : ControllerBase
|
|
{
|
|
[HttpGet("404")] //required
|
|
public IActionResult Handle404()
|
|
{
|
|
return NotFound(new { message = "Route not found." });
|
|
}
|
|
}
|