2017-10-02 21:57:48 +02:00
|
|
|
|
using Nancy;
|
2017-10-03 00:22:26 +02:00
|
|
|
|
using Geekbot.net.Lib;
|
2017-10-02 21:57:48 +02:00
|
|
|
|
|
|
|
|
|
namespace Geekbot.net.WebApi
|
|
|
|
|
{
|
2017-10-03 00:22:26 +02:00
|
|
|
|
public class StatusController : NancyModule
|
2017-10-02 21:57:48 +02:00
|
|
|
|
{
|
2017-10-03 00:22:26 +02:00
|
|
|
|
public StatusController()
|
2017-10-02 21:57:48 +02:00
|
|
|
|
{
|
|
|
|
|
Get("/", args =>
|
|
|
|
|
{
|
|
|
|
|
var responseBody = new ApiStatusDto()
|
|
|
|
|
{
|
2017-10-03 00:22:26 +02:00
|
|
|
|
GeekbotVersion = Constants.BotVersion.ToString(),
|
|
|
|
|
ApiVersion = Constants.ApiVersion.ToString(),
|
2017-10-02 21:57:48 +02:00
|
|
|
|
Status = "Online"
|
|
|
|
|
};
|
|
|
|
|
return Response.AsJson(responseBody);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ApiStatusDto
|
|
|
|
|
{
|
|
|
|
|
public string GeekbotVersion { get; set; }
|
|
|
|
|
public string ApiVersion { get; set; }
|
|
|
|
|
public string Status { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|