mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-05 16:37:09 +00:00
feat(display): ping route
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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