Updating
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Serilog;
|
||||
using LCU.Api.Internal.ArchiverApi.Models;
|
||||
namespace LCU.Api.Internal.ArchiverApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class StatusController : ControllerBase
|
||||
{
|
||||
private readonly IEnvironmentView _environmentView;
|
||||
|
||||
public StatusController(IEnvironmentView environmentView)
|
||||
{
|
||||
_environmentView = environmentView;
|
||||
}
|
||||
|
||||
[HttpGet()]
|
||||
[ProducesResponseType(200)]
|
||||
[ProducesResponseType(500)]
|
||||
public IActionResult Get()
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.Verbose($"{_environmentView.Application}'s status endpoint was hit in {_environmentView.Environment}");
|
||||
return Ok(_environmentView);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error("Failure return status, message: {0} {1}", e.Message, e.StackTrace);
|
||||
return StatusCode((int)System.Net.HttpStatusCode.InternalServerError);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user