This repository has been archived on 2024-03-29. You can view files and clone it, but cannot push or open issues or pull requests.
FreeSR/FreeSR.Admin/Handlers/ConsolePageRequestHandler.cs

26 lines
711 B
C#
Raw Normal View History

2024-01-27 13:06:07 +00:00
namespace FreeSR.Admin.Handlers
{
using Ceen;
using FreeSR.Admin.Service;
internal class ConsolePageRequestHandler : IHttpModule
{
public async Task<bool> HandleAsync(IHttpContext context)
{
context.Response.StatusCode = HttpStatusCode.OK;
await context.Response.WriteAllAsync(CreateHTMLDocument(), "text/html");
return true;
}
private static string CreateHTMLDocument()
{
string baseString = HttpAdminService.ConsoleHTML;
return baseString.Replace("%SERVER_VERSION%", "v0.1.0 dev - experimental open source")
.Replace("%GAME_VERSION%", "1.2.0");
}
}
}