Setting the NODE_ENV variable in an elastic shell

I created a file called .elasticbeanstalk / environment.config with the following:

option_settings:
  - option_name: NODE_ENV
    value: development

I also pass process.env.NODE_ENV to the view to check the value

app.get('/', function(req, res) {
  var data = {
    env: process.env.NODE_ENV
  }
  res.render('upload',data);
});

On my local machine, I get the value "local" to which I installed it. When I deploy to Amazons Elastic Beanstalk through $ git aws.push, the value is empty.

Is there anything else I need for EB to recognize the NODE_ENV setting?

+4
source share
1 answer

Your .config file should be located in the directory .ebextensions, not .elasticbeanstalk.

, , .

Elastic Beanstalk Console, . :

  • .
  • , , . "".
  • .
  • / .
+13

All Articles