1Panel/backend/router/ro_nginx.go

25 lines
714 B
Go
Raw Normal View History

2022-11-23 08:19:05 +00:00
package router
import (
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
"github.com/1Panel-dev/1Panel/backend/middleware"
"github.com/gin-gonic/gin"
)
type NginxRouter struct {
}
func (a *NginxRouter) InitNginxRouter(Router *gin.RouterGroup) {
groupRouter := Router.Group("openresty")
groupRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
2022-11-23 08:19:05 +00:00
baseApi := v1.ApiGroupApp.BaseApi
{
groupRouter.GET("", baseApi.GetNginx)
2022-11-24 02:28:39 +00:00
groupRouter.POST("/scope", baseApi.GetNginxConfigByScope)
2022-12-13 10:54:46 +00:00
groupRouter.POST("/update", baseApi.UpdateNginxConfigByScope)
2022-11-24 08:06:18 +00:00
groupRouter.GET("/status", baseApi.GetNginxStatus)
2022-12-09 09:16:07 +00:00
groupRouter.POST("/file", baseApi.UpdateNginxFile)
2022-11-23 08:19:05 +00:00
}
}