Setting up db connection

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-10 16:22:51 +01:00
parent 2de80ee8ab
commit f405c0174f
2 changed files with 5 additions and 5 deletions

View file

@ -4,11 +4,11 @@ import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
const pool = new Pool({
host: "127.0.0.1",
port: 5432,
user: "postgres",
password: "password",
database: "db_name",
host: process.env.DB_HOST,
port: Number(process.env.DB_PORT),
user: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
});
const db = drizzle(pool);

View file