Exemplo n.º 1
0
// Let's write two simple setup and teardown functions. Setup() will return an *httptest.Server setup using the
// router from the backend API. Teardown will close it after being deferred.
func Setup() *httptest.Server {
	context := &settings.AppContext{}
	router := router.ApiRouter(context)

	server := httptest.NewUnstartedServer(router)

	return server
}
Exemplo n.º 2
0
func main() {
	context := &settings.AppContext{}
	router := router.ApiRouter(context)
	log.Fatal(http.ListenAndServe(":8080", router))
}