Пример #1
0
// for appengine we don't use main to start the server
// because that is done for us by the platform. Instead
// we attach to the standard mux router. Note that we're
// using the appengine provider for storage and wiring
// it up to the engine and then the engine to the web.
func init() {
	s := appengine.NewStorage()
	e := engine.NewEngine(s)
	http.Handle("/", web.NewWebAdapter(e, false))
}
Пример #2
0
// when running in traditional or 'standalone' mode
// we're going to use MongoDB as the storage provider
// and start the webserver running ourselves.
func main() {
	s := mongodb.NewStorage(config.MongoURL)
	e := engine.NewEngine(s)
	http.ListenAndServe(":8080", web.NewWebAdapter(e, true))
}