gin path remove
This commit is contained in:
parent
d2fae8858e
commit
3aecbceef8
|
|
@ -23,10 +23,6 @@ var (
|
|||
)
|
||||
|
||||
func Service() {
|
||||
rootPath = os.Getenv("GIN_PATH")
|
||||
if rootPath == "" {
|
||||
rootPath = "/"
|
||||
}
|
||||
addr = os.Getenv("GIN_ADDR")
|
||||
if addr == "" {
|
||||
addr = "0.0.0.0"
|
||||
|
|
@ -42,7 +38,7 @@ func Service() {
|
|||
|
||||
go func() {
|
||||
router := gin.New()
|
||||
routerSetup(router, &rootPath)
|
||||
routerSetup(router)
|
||||
|
||||
if ssl == "true" {
|
||||
router.Use(tlsHandler())
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
package gin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 路由配置
|
||||
func routerSetup(router *gin.Engine, rootpath *string) {
|
||||
func routerSetup(router *gin.Engine) {
|
||||
router.Use(gin.Recovery())
|
||||
|
||||
r := router.Group(fmt.Sprintf("/%s", *rootpath))
|
||||
r := router.Group(`/`)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue