File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ func startHttpServer() {
37
37
}
38
38
})
39
39
40
+ // General API
41
+ e .GET ("/ping" , getPing )
42
+ e .GET ("/version" , getVersion )
43
+
40
44
// Volume API
41
45
e .GET ("/volumes" , fetchAllVolumes )
42
46
e .GET ("/volumes/:uuid" , fetchVolume )
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "net/http"
5
+
6
+ "github.com/labstack/echo/v4"
7
+ )
8
+
9
+ func getPing (c echo.Context ) error {
10
+ return c .JSON (http .StatusOK , Response {
11
+ Message : "Successfully fetched ping" ,
12
+ Data : "pong" ,
13
+ })
14
+ }
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "net/http"
5
+
6
+ "github.com/labstack/echo/v4"
7
+ )
8
+
9
+ const Version = "0.0.1"
10
+
11
+ func getVersion (c echo.Context ) error {
12
+ return c .JSON (http .StatusOK , Response {
13
+ Message : "Successfully fetched version" ,
14
+ Data : Version ,
15
+ })
16
+ }
You can’t perform that action at this time.
0 commit comments