Integrate cobra into the framework part1

This commit is contained in:
Muyao CHEN
2024-09-30 19:38:16 +02:00
parent fc4f94e967
commit 9da3012789
13 changed files with 159 additions and 42 deletions

14
app/web/kernel.go Normal file
View File

@ -0,0 +1,14 @@
package web
import "github.com/gin-gonic/gin"
func NewHttpEngine() (*gin.Engine, error) {
// Use ReleaseMode by default to not ouput debug info
gin.SetMode(gin.ReleaseMode)
r := gin.Default()
Routes(r)
return r, nil
}

View File

9
app/web/route.go Normal file
View File

@ -0,0 +1,9 @@
package web
import "github.com/gin-gonic/gin"
func Routes(r *gin.Engine) {
r.Static("/dist/", "./dist/")
// demo.Register(r)
}