2017-08-19 07:59:19 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using Bit.Core.Models.Api;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Api.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
public class MiscController : Controller
|
|
|
|
|
|
{
|
|
|
|
|
|
[HttpGet("~/alive")]
|
2017-10-06 15:30:54 -04:00
|
|
|
|
[HttpGet("~/now")]
|
2017-08-19 07:59:19 -04:00
|
|
|
|
public DateTime Get()
|
|
|
|
|
|
{
|
|
|
|
|
|
return DateTime.UtcNow;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("~/version")]
|
|
|
|
|
|
public VersionResponseModel Version()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new VersionResponseModel();
|
|
|
|
|
|
}
|
2018-05-21 21:18:19 -04:00
|
|
|
|
|
|
|
|
|
|
[HttpGet("~/ip")]
|
|
|
|
|
|
public JsonResult Ip()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new JsonResult(new
|
|
|
|
|
|
{
|
|
|
|
|
|
Ip = HttpContext.Connection?.RemoteIpAddress?.ToString(),
|
|
|
|
|
|
Headers = HttpContext.Request?.Headers,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2017-08-19 07:59:19 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|