feat(display): ping route

This commit is contained in:
2025-08-18 12:10:02 +02:00
parent 8d3bf0e32e
commit 330d63ebd8
2 changed files with 24 additions and 0 deletions
+9
View File
@@ -53,6 +53,8 @@ var supportedExtensions = map[string]bool{
".odp": true,
}
const Version = "0.1.0"
func main() {
var err error
@@ -87,6 +89,7 @@ func main() {
e.GET("/sse", sseRoute)
apiGroup := e.Group("/api")
apiGroup.GET("/ping", pingRoute)
apiGroup.PATCH("/shellCommand", shellCommandRoute)
apiGroup.PATCH("/keyboardInput", keyboardInputRoute)
apiGroup.PATCH("/showHTML", showHTMLRoute)
@@ -430,6 +433,12 @@ func showHTMLRoute(ctx echo.Context) error {
return ctx.NoContent(http.StatusOK)
}
func pingRoute(ctx echo.Context) error {
return ctx.JSON(http.StatusOK, struct {
Version string `json:"version"`
}{Version: Version})
}
// Reset previous file views so they dont collide with the new one
func resetView() error {
err := keyboardInput(keybd_event.VK_ESC)