How to run boot/script using node_env value

14 views
Skip to first unread message

Diego Curbelo

unread,
Jul 31, 2017, 9:38:37 AM7/31/17
to LoopbackJS
Hi All, thank to read this.

I researched how to setup different environment, for instance, I have test mongo db, prod mongo db, and local mongo dev.

I have a boot script will populate data on mongo dbs, but how to run those script according to node_env, for instance, if I am a developer, I will run create-models.js, but if I deploy to test environment I need to run create-models.test.js

I use a datasource.test.json or datasource.production.json to create different data source according to the environment I am deploying the API, but how to do the same for the boot/scripts files?

Best Regards,
Thanks
Reply all
Reply to author
Forward
0 new messages