week5-node-express-knex-pg/db/db.js
Jeannette Chin 58f45f8947 first commit
2024-10-21 17:09:40 +01:00

12 lines
277 B
JavaScript

import knex from "knex";
import { development, production } from "./knexfile.cjs";
const env = process.env.ENVIRONMENT || "development";
console.log(env);
console.log(development);
const db = env === "development" ? knex(development) : knex(production);
export default db;