How do I set Environment Variables for my Node.js application?

Environment Variables for Node.js are below :


Variable

Value Example

Description

APP_FILE

server.js

The main application file to be launched

AUTO_OLD_HEAP

TRUE

Turns on/off CloudJiffy memory autoconfiguration (sets maximum size of old heap based on the amount of memory on container)

HOME_DIR

/home/CloudJiffy

Container home directory (informational)

NODE_ENV

development

Specifies the environment in which an application is running (e.g. development, staging, production, testing, etc)

NODE_OPTIONS

--trace-warnings

Variable for specifying the V8 runtime options

NVM_DIR

informational

Path where NVM is installed

PACKAGE_MANAGER

npm

Variable which contains the name of the utility used for installing the javascript packages

PACKAGE_MANAGER_OPTS

 

Additional options for the package manager (refer to the official npmor yarn documentation)

PROCESS_MANAGER

npm

Variable for choosing the Node.js process manager (i.e. npm, pm2, forever, supervisor)

PROCESS_MANAGER_FILE

 

Path to the file which contains the start options for the process manager

ROOT_DIR

/home/CloudJiffy/ROOT

Sets a path to the directory for application deployment

STACK_NAME

nodejs

Name of the stack (informational)

STACK_SHORT_VERSION

6

Major version of the current template (informational)

UPDATE_PACKAGES_ON_RESTART

true

Enables/disables automatic packages installation after the nodejs service restart. If there is no node_modulesdirectory inside the webroot one, such an update is called regardless of the variable

 


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 14073