-
Notifications
You must be signed in to change notification settings - Fork 4
/
router.go
34 lines (28 loc) · 802 Bytes
/
router.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
package main
import (
"os"
"techtrainingcamp-AppUpgrade/admin"
"techtrainingcamp-AppUpgrade/service"
"github.com/gin-gonic/gin"
)
func customizeouter(r *gin.Engine) {
r.GET("/ping", service.Pong)
// r.GET("/judge1", service.Hit)
// r.GET("/judge2", service.HitSQL)
r.GET("/judge", service.Judge)
r.GET("/count", service.Count)
}
func adminRouter(r *gin.Engine) {
if os.Getenv("IS_DOCKER") == "1" {
r.LoadHTMLFiles("/root/public/index.html")
} else {
r.LoadHTMLFiles("./public/index.html")
}
r.GET("/index", admin.GetHTML)
r.GET("/query_all_rules", admin.QueryAllRules)
r.GET("/query_rule", admin.QueryRule)
r.POST("/update_rule", admin.UpdateRule)
r.POST("/create_rule", admin.CreateRule)
r.GET("/delete_rule", admin.DeleteRule)
r.GET("/disable_rule", admin.DisableRule)
}