Example #1
0
File: main.go Project: 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)
}
Example #2
0
func main() {

	mainRouter := router.Router()

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