update
This commit is contained in:
@@ -1,9 +1,19 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
r := Router()
|
r := Router()
|
||||||
r.LoadHTMLGlob("tmpl/*")
|
r.LoadHTMLGlob("tmpl/*")
|
||||||
r.Static("/statics", "./statics")
|
r.Static("/statics", "./statics")
|
||||||
|
|
||||||
r.Run(":88")
|
port := flag.Int("p", 88, "the port to listen on")
|
||||||
|
|
||||||
|
// 解析命令行参数
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
r.Run(":" + strconv.Itoa(*port))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user