- sails の起動処理が終わったときに、変数 sails が初期化されるので、起動処理中の config 内の.js ではsailsを介してそれを読み込むことはできない。
- The config/local.js file is useful for configuring a Sails app for your local environment (your laptop, for example).
- The settings in this file take precedence over all other config files except .sailsrc.
- 開発を終えて、サーバにデプロイする際は、このファイルを使用するのではなく、 環境変数 ( コマンドライン引数 や .sailsrc )を使うほうが良い。
sails lift --dev (default)
sails lift --prod
- チーム開発では個々人のユーザ名とDBパスワードなどを書いておく。
使い方
module.exports = {
connections: {
mysqlServer: {
host: 'localhost',
user: 'YOUR_URSER_NAME',
password: 'YOUR_PASSWORD'
}
}
}
module.exports.connections = {
mysqlServer: {
adapter: 'sails-mysql',
database: 'YOUR_DATABASE_NAME'
}
}