Пример #1
0
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)
}