Skip to content

allen870409/go-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-router

修改自 beego router.
出處
https://github.com/astaxie/beego

	// 初始化路由器
	var myRouter router.ControllerRegistor
	// 註冊網頁靜態頁面路徑
	myRouter.SetStaticPath("/", "/html/")

	// 路由器 controller 註冊開始
	myRouter.Add("/", &controllers.IndexController{})

	// 註冊結束 啟動伺服器
	http.HandleFunc("/", myRouter.ServeHTTP)

	open.Run("http://127.0.0.1:8123")
	http.ListenAndServe(":8123", nil)

Releases

No releases published

Packages

No packages published

Languages

  • Go 83.6%
  • HTML 14.1%
  • JavaScript 2.3%