Skip to content

Commit 0f01aa6

Browse files
reverted the db.ts addition of test_host
1 parent 01fad41 commit 0f01aa6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

envFiles/.env.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ API_RATE_LIMIT_REFILL_RATE=100
5151
# https://vitest.dev/config/#watch
5252
CI=true
5353
# https://blog.platformatic.dev/handling-environment-variables-in-nodejs#heading-set-nodeenvproduction-for-all-environments
54-
NODE_ENV=test
54+
NODE_ENV=production
5555
BETTER_AUTH_SECRET=jvc2rzepazKXR1Glj72lfiW9iOkjZnve
5656
API_CORS_ORIGIN=http://localhost:4321
5757
########## docker compose `api` container service ##########

src/lib/db.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import dotenv from "dotenv";
21
import { drizzle } from "drizzle-orm/postgres-js";
32
import envSchema from "env-schema";
43
import postgres from "postgres";
@@ -7,15 +6,14 @@ import {
76
envConfigSchema,
87
envSchemaAjv,
98
} from "../envConfigSchema";
10-
dotenv.config();
119

1210
const envConfig = envSchema<EnvConfig>({
1311
ajv: envSchemaAjv,
1412
dotenv: true,
1513
schema: envConfigSchema,
1614
});
1715

18-
const DATABASE_URL = `postgres://${envConfig.API_POSTGRES_USER}:${envConfig.API_POSTGRES_PASSWORD}@${envConfig.NODE_ENV === "test" ? process.env.API_POSTGRES_TEST_HOST : envConfig.API_POSTGRES_HOST}:${envConfig.API_POSTGRES_PORT}/${envConfig.API_POSTGRES_DATABASE}`;
16+
const DATABASE_URL = `postgres://${envConfig.API_POSTGRES_USER}:${envConfig.API_POSTGRES_PASSWORD}@${envConfig.API_POSTGRES_HOST}:${envConfig.API_POSTGRES_PORT}/${envConfig.API_POSTGRES_DATABASE}`;
1917

2018
let client: postgres.Sql;
2119

0 commit comments

Comments
 (0)