mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
feat: maintenance mode #739
This commit is contained in:
parent
191ddea309
commit
5d3f478086
33 changed files with 3698 additions and 2222 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
nginxLog "github.com/0xJacky/Nginx-UI/api/nginx_log"
|
||||
"github.com/0xJacky/Nginx-UI/api/notification"
|
||||
"github.com/0xJacky/Nginx-UI/api/openai"
|
||||
"github.com/0xJacky/Nginx-UI/api/pages"
|
||||
"github.com/0xJacky/Nginx-UI/api/public"
|
||||
"github.com/0xJacky/Nginx-UI/api/settings"
|
||||
"github.com/0xJacky/Nginx-UI/api/sites"
|
||||
|
@ -35,13 +36,15 @@ func InitRouter() {
|
|||
|
||||
initEmbedRoute(r)
|
||||
|
||||
pages.InitRouter(r)
|
||||
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
c.JSON(http.StatusNotFound, gin.H{
|
||||
"message": "not found",
|
||||
})
|
||||
})
|
||||
|
||||
root := r.Group("/api")
|
||||
root := r.Group("/api", middleware.IPWhiteList())
|
||||
{
|
||||
public.InitRouter(root)
|
||||
crypto.InitPublicRouter(root)
|
||||
|
|
|
@ -9,9 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func initEmbedRoute(r *gin.Engine) {
|
||||
r.Use(
|
||||
middleware.CacheJs(),
|
||||
middleware.IPWhiteList(),
|
||||
static.Serve("/", middleware.MustFs("")),
|
||||
)
|
||||
r.Use(middleware.CacheJs())
|
||||
|
||||
r.GET("/", middleware.IPWhiteList(), static.Serve("/", middleware.MustFs("")))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue