diff --git a/cmd/api/handlers_test.go b/cmd/api/handlers_test.go index 6533450..3051c66 100644 --- a/cmd/api/handlers_test.go +++ b/cmd/api/handlers_test.go @@ -44,8 +44,15 @@ func flushRedisForTest(t *testing.T, client *redis.Client) { } func newMockHandlerContext() *HandlerContext { + // Read Redis address from environment, default to localhost:6379 + redisAddr := os.Getenv("REDIS_ADDR") + if redisAddr == "" { + redisAddr = "localhost:6379" + } redisClient := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", + Addr: redisAddr, + Password: "", + DB: 0, }) // Create an empty routing graph