예제 #1
0
파일: main.go 프로젝트: Tangmz/Blog
func main() {
	fmt.Println("Start")
	http.Handle("/", http.FileServer(http.Dir("../../Blog")))
	log.Println("Debug", "action")
	//----------------------- 日志文件初始化 -----------------------------------
	logger.Init()

	//----------------------- 请求处理初始化 -----------------------------------
	baseop.Init()

	//----------------------- 设置路由 -----------------------------------------
	router.Router()

	//----------------------- 数据库初始化 -------------------------------------
	database.Init()

	//----------------------- 监听端口 -----------------------------------------
	http.ListenAndServe(":80", nil)
}
예제 #2
0
func main() {

	mainRouter := router.Router()

	log.Fatal(http.ListenAndServe(":8080", mainRouter))
}