mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
feat(display): ping route
This commit is contained in:
@@ -53,6 +53,8 @@ var supportedExtensions = map[string]bool{
|
|||||||
".odp": true,
|
".odp": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Version = "0.1.0"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
@@ -87,6 +89,7 @@ func main() {
|
|||||||
e.GET("/sse", sseRoute)
|
e.GET("/sse", sseRoute)
|
||||||
|
|
||||||
apiGroup := e.Group("/api")
|
apiGroup := e.Group("/api")
|
||||||
|
apiGroup.GET("/ping", pingRoute)
|
||||||
apiGroup.PATCH("/shellCommand", shellCommandRoute)
|
apiGroup.PATCH("/shellCommand", shellCommandRoute)
|
||||||
apiGroup.PATCH("/keyboardInput", keyboardInputRoute)
|
apiGroup.PATCH("/keyboardInput", keyboardInputRoute)
|
||||||
apiGroup.PATCH("/showHTML", showHTMLRoute)
|
apiGroup.PATCH("/showHTML", showHTMLRoute)
|
||||||
@@ -430,6 +433,12 @@ func showHTMLRoute(ctx echo.Context) error {
|
|||||||
return ctx.NoContent(http.StatusOK)
|
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
|
// Reset previous file views so they dont collide with the new one
|
||||||
func resetView() error {
|
func resetView() error {
|
||||||
err := keyboardInput(keybd_event.VK_ESC)
|
err := keyboardInput(keybd_event.VK_ESC)
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
meta {
|
||||||
|
name: ping
|
||||||
|
type: http
|
||||||
|
seq: 7
|
||||||
|
}
|
||||||
|
|
||||||
|
get {
|
||||||
|
url: 127.0.0.1:1323/api/ping
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user