Adding first version of the api rewrite.
Removing many dependencies.
This commit is contained in:
20
Minimal-server/GotobedServer/Program.cs
Normal file
20
Minimal-server/GotobedServer/Program.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var app = builder.Build();
|
||||
var welcomeMessage = "Go to bed server.";
|
||||
var status = handler.FirstRun.status("https://github.com/Myxelium/go-to-bed/");
|
||||
handler.MdsService.Start();
|
||||
|
||||
app.MapGet("/", () => Results.Text(welcomeMessage + "Status: " + status, "text/html"));
|
||||
|
||||
app.MapPost("/go-to-bed/sleep", () => handler.ShutdownCommand.Hibernate());
|
||||
|
||||
app.MapPost("/go-to-bed/shutdown", () => handler.ShutdownCommand.Shutdown());
|
||||
|
||||
app.MapPost("/go-to-bed/reboot", () => handler.ShutdownCommand.Reboot());
|
||||
|
||||
app.MapPost("/go-to-bed/logout", () => handler.ShutdownCommand.Logout());
|
||||
|
||||
app.MapPost("/go-to-bed/lock", () => handler.ShutdownCommand.Lock());
|
||||
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user