123456789101112131415161718192021222324252627282930313233 |
- package web
- import (
- "git.sfnt.net/sfnt/cnlink/web/api"
- "github.com/gin-gonic/gin"
- )
- func Start() {
- r := gin.Default()
- //r.LoadHTMLGlob("views/*")
- r.LoadHTMLGlob("views/**/*")
- r.GET("/", func(c *gin.Context) {
- c.JSON(200, gin.H{
- "message": "home page",
- })
- })
- r.GET("/ver", api.CheckVersion)
- r.GET("/health", api.CheckHealth)
- /*
- r.GET("/create", func(c *gin.Context) {
- c.JSON(200, gin.H{
- "message": "create page",
- })
- })
- */
- r.GET("/u:sid", func(c *gin.Context) {
- c.JSON(200, gin.H{
- "message": c.Params.ByName("sid"),
- })
- //c.Redirect(http.StatusFound,"")
- })
- r.Run()
- }
|