From: xangelo Date: Thu, 1 Jun 2023 16:35:53 +0000 (-0400) Subject: swap to using env file X-Git-Tag: v0.0.1~91 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=14fe7d59469c6d9fa9ca13d8a2c3315631f6cb50;p=risinglegends.git swap to using env file --- diff --git a/src/server/lib/db.ts b/src/server/lib/db.ts index 179cdca..4402c5a 100644 --- a/src/server/lib/db.ts +++ b/src/server/lib/db.ts @@ -1,11 +1,14 @@ import knex from "knex"; +import { config as dotenv } from 'dotenv'; + +dotenv(); export const db = knex({ client: 'pg', connection: { host: 'localhost', - user: 'postgres', - password: 'root', - database: 'tiny_kingdom' + user: process.env.PG_USER, + password: process.env.PG_PASSWORD, + database: process.env.PG_DATABASE } });