forked from open-falcon/falcon-plus
/
routes.go
36 lines (33 loc) · 1.22 KB
/
routes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package controller
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/alarm"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/dashboard_graph"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/dashboard_screen"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/expression"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/graph"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/host"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/mockcfg"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/strategy"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/template"
"github.com/open-falcon/falcon-plus/modules/api/app/controller/uic"
"github.com/open-falcon/falcon-plus/modules/api/app/utils"
)
func StartGin(port string, r *gin.Engine) {
r.Use(utils.CORS())
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello, I'm Falcon+ (。A。)")
})
graph.Routes(r)
uic.Routes(r)
template.Routes(r)
strategy.Routes(r)
host.Routes(r)
expression.Routes(r)
mockcfg.Routes(r)
dashboard_graph.Routes(r)
dashboard_screen.Routes(r)
alarm.Routes(r)
r.Run(port)
}