Exemplo n.º 1
0
func main() {
	database.InitPuppyDB()

	breed := ""
	searchResults := GetPuppySearchResults(breed)
	AddPuppySearchResults(breed, searchResults)
}
Exemplo n.º 2
0
func main() {
	// Set up database connection
	log.Println("Setting up DB...")
	database.InitPuppyDB()

	// Set up URL routes
	http.HandleFunc("/", Index)
	http.HandleFunc("/puppy", Puppy)
	http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))

	// Start the server
	log.Println("Listening...")
	err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
	if err != nil {
		log.Fatal(err)
	}
}