示例#1
0
文件: main.go 项目: hfeeki/bingo
func main() {
	handler := rest.ResourceHandler{}
	handler.SetRoutes(
		rest.Route{"GET", "/users/:id", GetUser},
	)
	http.ListenAndServe(":8081", &handler)
}
示例#2
0
func main() {

	handler := rest.ResourceHandler{
		EnableRelaxedContentType: true,
		DisableJsonIndent:        true,
	}

	handler.SetRoutes(
		rest.Route{"GET", "/rest/api/v1/im", callScenario1},
	)
	http.ListenAndServe(":8080", &handler)
}