예제 #1
0
파일: zest.go 프로젝트: 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
}
예제 #2
0
파일: zest.go 프로젝트: wid-la/wus
func New() *Zest {
	return &Zest{
		Environment: "development",
		Port:        "3000",
		App:         negroni.New(),
		Swagger:     infrastructure.NewSwagger(),
		Injector:    infrastructure.NewInjector(),
	}
}