refactor: migrate to new cosy

This commit is contained in:
Jacky 2024-10-22 16:38:38 +08:00
parent 6082aef5d5
commit 33a996e777
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
111 changed files with 1163 additions and 1772 deletions

View file

@ -19,14 +19,13 @@ import (
"github.com/0xJacky/Nginx-UI/internal/middleware"
"github.com/gin-contrib/static"
"github.com/gin-gonic/gin"
"github.com/uozi-tech/cosy"
"net/http"
)
func InitRouter() *gin.Engine {
r := gin.New()
func InitRouter() {
r := cosy.GetEngine()
r.Use(
gin.Logger(),
middleware.Recovery(),
middleware.CacheJs(),
middleware.IPWhiteList(),
static.Serve("/", middleware.MustFs("")),
@ -78,6 +77,4 @@ func InitRouter() *gin.Engine {
system.InitWebSocketRouter(w)
}
}
return r
}