我想更改
config.json
到
config.js
为了能够使用环境变量。
const path = require('path');
module.exports = {
'config': path.resolve('config', 'config.js'),
'models-path': path.resolve('models'),
'seeders-path': path.resolve('seeders'),
'migrations-path': path.resolve('migrations')
}
这与CLI sequelize的工作原理一样,我可以创建模型或启动迁移,但无法启动服务器,因为它会查找文件
所以我的问题是如何确保服务器启动时能够读取
.
node bin/www
我收到
Error: Cannot find module '/nodeTest/nodejs-relationships/models/../config/config.json'