20 lines
266 B
Go
20 lines
266 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"strconv"
|
|
)
|
|
|
|
func main() {
|
|
r := Router()
|
|
r.LoadHTMLGlob("tmpl/*")
|
|
r.Static("/statics", "./statics")
|
|
|
|
port := flag.Int("p", 88, "the port to listen on")
|
|
|
|
// 解析命令行参数
|
|
flag.Parse()
|
|
|
|
r.Run(":" + strconv.Itoa(*port))
|
|
}
|