initial commit.
This commit is contained in:
13
src/db.js
Normal file
13
src/db.js
Normal file
@ -0,0 +1,13 @@
|
||||
// Importing the Knex library
|
||||
import knex from 'knex';
|
||||
import 'dotenv/config'
|
||||
|
||||
if (!process.env.DB_URL) {
|
||||
fail("Ensure you set DB_URL");
|
||||
};
|
||||
|
||||
// Creating an instance of Knex
|
||||
export const db = knex({
|
||||
client: 'postgres',
|
||||
connection: process.env.DB_URL
|
||||
});
|
Reference in New Issue
Block a user