示例#1
0
文件: main.go 项目: delicb/mezvaro
func main() {
	m := mv.New()
	m.UseFunc(Middleware1, Middleware2)
	http.Handle("/hello", m.HF(HelloHandler))
	http.Handle("/workd", m.HF(WorldHandler))
	http.ListenAndServe(":8000", nil)
}
示例#2
0
文件: main.go 项目: delicb/mezvaro
func main() {
	m := mv.New(mv.HandlerFunc(LoggingMiddleware)) // all calls go through logging middleware
	authOnly := m.Fork(mv.HandlerFunc(AuthMiddleware))
	http.Handle("/public", m.HF(PubliclyAvailable))
	http.Handle("/auth", authOnly.HF(PrivatelyAvailable))
	http.ListenAndServe(":8000", nil)
}
示例#3
0
文件: main.go 项目: delicb/mezvaro
func main() {
	m := mv.New(UserAgentExtractor{verbose: true})
	http.Handle("/", m.HF(BrowserInfoHandler))
	http.ListenAndServe(":8000", nil)
}