Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create new Environment config sails.js

Tags:

sails.js

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

like image 945
dpineda Avatar asked Mar 08 '15 05:03

dpineda


2 Answers

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
like image 125
sgress454 Avatar answered Nov 19 '22 19:11

sgress454


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.

like image 4
Glen Swift Avatar answered Nov 19 '22 19:11

Glen Swift