Replace nancy with kestrel
This commit is contained in:
parent
3004b19209
commit
8c107de92e
13 changed files with 222 additions and 117 deletions
9
Geekbot.net/WebApi/Controllers/Status/ApiStatusDto.cs
Normal file
9
Geekbot.net/WebApi/Controllers/Status/ApiStatusDto.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace Geekbot.net.WebApi.Controllers.Status
|
||||
{
|
||||
public class ApiStatusDto
|
||||
{
|
||||
public string GeekbotVersion { get; set; }
|
||||
public string ApiVersion { get; set; }
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
22
Geekbot.net/WebApi/Controllers/Status/StatusController.cs
Normal file
22
Geekbot.net/WebApi/Controllers/Status/StatusController.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using Geekbot.net.Lib;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Geekbot.net.WebApi.Controllers.Status
|
||||
{
|
||||
[EnableCors("AllowSpecificOrigin")]
|
||||
public class StatusController : Controller
|
||||
{
|
||||
[Route("/")]
|
||||
public IActionResult GetCommands()
|
||||
{
|
||||
var responseBody = new ApiStatusDto
|
||||
{
|
||||
GeekbotVersion = Constants.BotVersion(),
|
||||
ApiVersion = Constants.ApiVersion.ToString(),
|
||||
Status = "Online"
|
||||
};
|
||||
return Ok(responseBody);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue