Files
gf/geg/net/ghttp/server/static/static_path.go
2019-04-03 00:03:46 +08:00

15 lines
321 B
Go

package main
import "github.com/gogf/gf/g"
// 静态文件服务器,支持自定义静态目录映射
func main() {
s := g.Server()
s.SetIndexFolder(true)
s.SetServerRoot("/Users/john/Temp")
s.AddSearchPath("/Users/john/Documents")
s.AddStaticPath("/my-doc", "/Users/john/Documents")
s.SetPort(8199)
s.Run()
}