There are 2 to Environments config on /config/env/
development.js
and production.js
You can run production config with: sails lift --prod
development runs by default: sails lift
how to create staging environment config like /config/env/staging.js
and run with: sails lift --staging
The --prod
argument is built-in to the Sails CLI; there's no mechanism for adding new arguments to that currently. But you can get the same effect using the NODE_ENV
environment variable:
linux & mac:
export NODE_ENV=staging sails lift
windows:
set NODE_ENV=production
It is extremely easy in sails 0.11. Now you can just add subfolder to you config/env
directory and sails engine will interpret it as new environment.
In your case you just need to create folder config/env/staging
, put there all needed configuration files and start your application with
NODE_ENV=staging sails lift
Migration guide for sails 0.11 you can find in documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With