swap to using env file
authorxangelo <git@xangelo.ca>
Thu, 1 Jun 2023 16:35:53 +0000 (12:35 -0400)
committerxangelo <git@xangelo.ca>
Thu, 1 Jun 2023 16:35:53 +0000 (12:35 -0400)
src/server/lib/db.ts

index 179cdca9647eb2fbaf898d780fe0807d2aeceeb8..4402c5a40f9dfe41360f385ff63f2d888ad9fc0c 100644 (file)
@@ -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
   }
 });