node-backend-example/src/db.js

14 lines
260 B
JavaScript

// 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 default knex({
client: 'postgres',
connection: process.env.DB_URL
});