This commit is contained in:
2023-03-08 20:24:16 +08:00
parent c9a41c29bd
commit cc6a22aa60
+11 -1
View File
@@ -1,9 +1,19 @@
package main
import (
"flag"
"strconv"
)
func main() {
r := Router()
r.LoadHTMLGlob("tmpl/*")
r.Static("/statics", "./statics")
r.Run(":88")
port := flag.Int("p", 88, "the port to listen on")
// 解析命令行参数
flag.Parse()
r.Run(":" + strconv.Itoa(*port))
}