Beispiel #1
0
func main() {
	settings.Init()
	router := routers.InitRoutes()
	n := negroni.Classic()
	n.UseHandler(router)
	http.ListenAndServe(":5000", n)
}
Beispiel #2
0
func (db *Db_sessions) NewHttpServer(address string, port int) *http.Server {
	router := routers.InitRoutes(db.mongo_session, db.mysql_session)
	listener := &http.Server{
		Addr:    fmt.Sprintf("%s:%d", address, port),
		Handler: router,
	}

	logging.Logger.Info("Server started")
	return listener
}