34 lines
964 B
C#
34 lines
964 B
C#
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);
|
|
}
|
|
}
|
|
} |