func init() {

	settings.SetPreproductionEnv()
	GlobalRepStore = &RepStore{ConnectToMongoCol()}

	populateMongoCol(GlobalRepStore.Col)
}
func init() {

	settings.SetPreproductionEnv()
	GlobalAnswerStore = &AnswerStore{ConnectToPostgres()}

	dropPostgresTables(GlobalAnswerStore.DB)
	initializePostgres(GlobalAnswerStore.DB)
	populatePostgres(GlobalAnswerStore.DB)

}
Exemple #3
0
func main() {

	settings.SetPreproductionEnv() // Set GO_ENV to "preproduction"

	db := datastores.ConnectToPostgres()

	ac := auth.NewAuthContext(&datastores.JWTStore{datastores.ConnectToRedis()})
	c := &m.Context{ac, &datastores.RepStore{datastores.ConnectToMongoCol()}, nil}

	r := handlers.AssignHandlersToRoutes(c, db)
	http.Handle("/", &Server{r})

	fmt.Println("Listening on port 3030")
	http.ListenAndServe(":3030", nil)
}
func init() {
	settings.SetPreproductionEnv()
	GlobalQuestionStore = &QuestionStore{ConnectToPostgres()}
}
func init() {
	settings.SetPreproductionEnv()
	GlobalUserStore = &UserStore{DB: ConnectToPostgres()}

}
func init() {
	settings.SetPreproductionEnv()
}
func init() {
	settings.SetPreproductionEnv()
	GlobalTokenStore = &JWTStore{ConnectToRedis()}
}