Skip to content

Commit

Permalink
Changing ENV ENVIRONMENT name
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitbbhayani committed Dec 10, 2024
1 parent e0fc3e2 commit e448d78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ DICEDB_ADMIN_PASSWORD=
DICEDB_ADDR=localhost:7380
DICEDB_USERNAME=dice
DICEDB_PASSWORD=
SERVER_PORT=:8080
IS_TEST_ENVIRONMENT=false
PORT=:8080
ENVIRONMENT=production
REQUEST_LIMIT_PER_MIN=1000
REQUEST_WINDOW_SEC=60
ALLOWED_ORIGINS=http://localhost:3000
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func LoadConfig() *Config {
AllowedOrigins []string
CronCleanupFrequency time.Duration
}{
Port: getEnv("SERVER_PORT", ":8080"),
IsTestEnv: getEnvBool("IS_TEST_ENVIRONMENT", false), // Default server port
Port: getEnv("PORT", ":8080"),
IsTestEnv: getEnv("ENVIRONMENT", "local") != "production", // Default server port
RequestLimitPerMin: getEnvInt("REQUEST_LIMIT_PER_MIN", 1000), // Default request limit
RequestWindowSec: getEnvFloat64("REQUEST_WINDOW_SEC", 60), // Default request window in float64
AllowedOrigins: getEnvArray("ALLOWED_ORIGINS", []string{"http://localhost:3000"}), // Default allowed origins
Expand Down
3 changes: 1 addition & 2 deletions internal/tests/integration/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func TestMain(m *testing.M) {
}
diceDBAddr := "localhost:" + port.Port()
os.Setenv("DICEDB_ADDR", diceDBAddr)

os.Setenv("IS_TEST_ENVIRONMENT", "true")
os.Setenv("ENVIRONMENT", "local")

code := m.Run()
os.Exit(code)
Expand Down

0 comments on commit e448d78

Please sign in to comment.