Using .env for secrets #4

This commit is contained in:
2025-10-02 10:54:33 +02:00
parent aabf3b2dbb
commit 39b7d58a24
3 changed files with 50 additions and 4 deletions
+5 -4
View File
@@ -1,11 +1,12 @@
import { envEnsure, envNumber } from "@/lib/env";
import { Pool } from "pg";
const pool = new Pool({
user: "klestiselimaj",
host: "localhost",
user: envEnsure("DB_USER"),
host: envEnsure("DB_HOST"),
database: "postgres",
password: "",
port: 5432,
password: envEnsure("DB_PASSWORD"),
port: envNumber("DB_PORT") || 5432,
});
const createUsersTableQuery = `