Integrate cobra into the framework part1
This commit is contained in:
14
app/web/kernel.go
Normal file
14
app/web/kernel.go
Normal 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
|
||||
}
|
0
app/web/module/demo/service.go
Normal file
0
app/web/module/demo/service.go
Normal file
9
app/web/route.go
Normal file
9
app/web/route.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user