【发布时间】:2016-08-24 15:31:19
【问题描述】:
我曾经在 config/env/development.js 和 config/env/production.js 中配置 Sails 到我的数据库的连接:
module.exports = {
connections: {
'postgres': {
host: 'localhost',
user: 'myUser',
password: 'myPassword',
database: 'myDatabase'
}
}
};
如果我想按照here 的说明用环境变量替换我的环境配置文件怎么办?
我希望使用这些变量,但它不起作用:
- sails__connections_postgres_host
- sails__connections_postgres_user
- sails__connections_postgres_password
- sails__connections_postgres_database
【问题讨论】:
-
试试看怎么样?
标签: configuration sails.js environment-variables configuration-files