|
// 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
|
|
});
|