Esempio n. 1
0
File: zest.go Progetto: wid-la/wus
func Classic() *Zest {
	zest := &Zest{
		Environment:      "development",
		Port:             "3000",
		App:              negroni.New(),
		Swagger:          infrastructure.NewSwagger(),
		Injector:         infrastructure.NewInjector(),
		HandleOsArgs:     handleOsArgs,
		Build:            buildApp,
		AfterBuild:       func(z *Zest) error { return nil },
		Init:             initApp,
		AfterInit:        func(z *Zest) error { return nil },
		Close:            closeApp,
		ReinitDatabase:   reinitDatabase,
		SeedDatabase:     seedDatabase,
		UserSeedDatabase: func(z *Zest) error { return nil },
		UpdateDatabase:   updateDatabase,
	}

	env := os.Getenv("GOENV")
	if env == "development" || env == "production" {
		zest.Environment = env
	}

	port := os.Getenv("PORT")
	if port != "" {
		zest.Port = os.Getenv("PORT")
	}

	zest.DatabaseURL = os.Getenv("DATABASE_URL")

	return zest
}
Esempio n. 2
0
File: zest.go Progetto: wid-la/wus
func New() *Zest {
	return &Zest{
		Environment: "development",
		Port:        "3000",
		App:         negroni.New(),
		Swagger:     infrastructure.NewSwagger(),
		Injector:    infrastructure.NewInjector(),
	}
}