gin path remove

This commit is contained in:
suguo.yao 2024-08-20 16:04:01 +08:00
parent d2fae8858e
commit 3aecbceef8
2 changed files with 3 additions and 9 deletions

View File

@ -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())

View File

@ -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(`/`)
{
}
}