Esempio n. 1
0
func main() {

	db := database.NewDB()
	defer db.Close()

	go riskzone.Execute(db)

	orm.Init()
	defer orm.Close()

	go geocode.Parallel(orm.Get())

	gob.Register(models.User{})
	gob.Register(models.Address{})

	middleware := negroni.Classic()
	middleware.Use(negroni.NewStatic(http.Dir("templates")))
	middleware.Use(sessions.Sessions("dne", cookiestore.New([]byte(uuid.NewV4().String()))))
	middleware.UseFunc(Authenticate)
	middleware.UseHandler(routers.GetControllers())
	middleware.Run(":8081")

}
Esempio n. 2
0
func (c *MainController) Get() *MainController {
	c.DB = database.Get()
	c.ORM = orm.Get()
	c.Render = tools.GetRender()
	return c
}