mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 14:22:33 +03:00
feat: hide seeds under env var
This commit is contained in:
parent
d456be5e9a
commit
ac006d5f1b
@ -1,3 +1,4 @@
|
||||
ENV=debug
|
||||
PORT=3000
|
||||
SEED_DB=true
|
||||
POSTGRES_URL=postgres://localhost/micrach
|
@ -9,6 +9,7 @@ import (
|
||||
type AppConfig struct {
|
||||
Env string
|
||||
Port int
|
||||
SeedDb bool
|
||||
}
|
||||
|
||||
type DbConfig struct {
|
||||
@ -30,9 +31,13 @@ func getAppConfig() AppConfig {
|
||||
panic(fmt.Sprintf("Could not parse %s to int", portString))
|
||||
}
|
||||
|
||||
seedDbString := os.Getenv("SEED_DB")
|
||||
seedDb := seedDbString == "true"
|
||||
|
||||
return AppConfig{
|
||||
Env: env,
|
||||
Port: port,
|
||||
SeedDb: seedDb,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user