示例#1
0
文件: router.go 项目: num5/deep-space
func RunHttp(addr int) {
	web.SetTrac(true)

	r := web.New()

	Routes(r)

	log.CLog("[TRAC] Server start listen on # %d #\n", addr)

	err := http.ListenAndServe(":"+strconv.Itoa(addr), r)

	if err != nil {
		panic(err)
	}
}
示例#2
0
文件: main.go 项目: num5/spider
func main() {

	r := web.New()

	r.Get("/", fc)

	log.CLog("[TRAC] Server start listen on # %d #", 9900)

	err := http.ListenAndServe(":9900", r)

	if err != nil {
		panic(err)
	}

}