Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PageMiddleware ¶
type PageMiddleware struct {
*fw.MiddlewareGlobal
// contains filtered or unexported fields
}
PageMiddleware 页面中间件
func NewPageMiddleware ¶
func NewPageMiddleware(dir ...string) *PageMiddleware
func (*PageMiddleware) DoInitOnce ¶
func (p *PageMiddleware) DoInitOnce()
func (*PageMiddleware) Router ¶
func (p *PageMiddleware) Router(ctx *fw.MiddlewareContext) []*fw.RouteItem
type PageOptions ¶
type PageOptions struct {
DirPath string `yaml:"dir_path" default:"./dist"` // 资源目录
RoutePath string `yaml:"route_path" default:"/"` // 路由
TryFiles string `yaml:"try_files" default:"/index.html"` // try_files 兼容nginx的try_files
Base string `yaml:"base" default:""` //打包时的base (例如vite的base, 即前端打包时的根路径) 例如 /web
}
Click to show internal directories.
Click to hide internal directories.