-
Notifications
You must be signed in to change notification settings - Fork 1
/
knexfile.js
21 lines (18 loc) · 654 Bytes
/
knexfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Everything required here must be in dependencies, not devDependencies
// because this file is also run in production environment
var config = require('./src/database').config;
// All possible NODE_ENVs should be listed here
// This is issue with knex
// See https://github.com/tgriesser/knex/issues/328
var envs = {
development: config,
test: config,
production: config
};
if (!envs.hasOwnProperty(process.env.NODE_ENV)) {
console.error('NODE_ENV is not set!');
console.error('Set NODE_ENV manually, or running e.g. source .env');
console.error('\n');
throw new Error('Environment is not set');
}
module.exports = envs;