Commit 6b442be3 by 邓梁

main.go

parent dbae01d7
...@@ -9,14 +9,16 @@ import ( ...@@ -9,14 +9,16 @@ import (
) )
func main() { func main() {
h := server.Default() h := server.Default(
server.WithHostPorts(":8970"),
)
route.Register(h) route.Register(h)
h.LoadHTMLGlob("html/*") h.LoadHTMLGlob("html/*")
h.Static("/", "./html") h.Static("/", "./html")
h.GET("/", func(c context.Context, ctx *app.RequestContext) { // h.GET("/", func(c context.Context, ctx *app.RequestContext) {
ctx.HTML(200, "index.html", nil) // ctx.HTML(200, "index.html", nil)
}) // })
h.Spin() h.Spin()
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment