pm2 Ecosystem Global Variables

15 viewsnode.jspm2
0

I have pm2.ecosystem.json file like below

{
  "apps": [
    {
      "name": "api",
      "script": "build/index.js",
      "cwd": "../services/api/",
      "exec_mode": "fork",
      "instances": 1
    },
    {
      "name": "api-2",
      "script": "build/index.js",
      "cwd": "../services/api-2/",
      "exec_mode": "fork",
      "instances": 1
    }
  ],
  "env": {
      "TEST": "TEST",
      "OTHER": "OTHER"
   }
}

When I run my project, I can not reach that env variables. How can I describe my env variables to all pm2 apps. It has to be common for all pm2 apps.