// Setup the server func (f *TestSuite) SetUpSuite(c *C) { // Set our environment to testing os.Setenv("DISTRIBUTOR_ENV", "test") // Start our server conn := httptest.NewServer(resources.NewRouter()) f.Endpoint = conn.URL f.Server = conn }
func main() { // Start the server router := resources.NewRouter() println("Listening at :8080") c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) signal.Notify(c, syscall.SIGTERM) go func() { <-c fmt.Println("\nShutting down nodes") shutdown.Shutdown() os.Exit(1) }() err := http.ListenAndServe(":8080", router) log.Fatal(err) }