Reputation: 3360
Is there a way to set/configure NODE_ENV for an ironworker task? It's not set in the process.env
output. Because of that the config
module loads config/development.json
configuration file.
Upvotes: 0
Views: 137
Reputation: 226
The way Iron recommends doing this is a bit annoying (http://dev.iron.io/worker/reference/configuration-variables/#config-via-file):
I have another method which is easier: using arguments to npm start
:
env = process.argv[2] || process.env.NODE_ENV
npm start -- <env>
as the run command to the iron cliUpvotes: 0
Reputation: 26
There are a couple ways to set this value. First you can send ENV params with the -e flag, as noted here https://github.com/iron-io/dockerworker/tree/master/node#2-test-locally
Iron actually recommends that you provide this information as part of the configuration and payload when creating a task.
Upvotes: 1