rooseveltframework / roosevelt

🧸 MVC web framework for Node.js designed to make Express easier to use.
Other
68 stars 33 forks source link

Arguments broken when using something like PM2 #340

Closed alallier closed 6 years ago

alallier commented 6 years ago

Roosevelt won't source arguments when using something like PM2. This is due to this block of code.

When using PM2 arguments look like this

[ '/usr/bin/node',
  '/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js',
  '--development-mode' ]

The source name app.js in this case is not in the argument list, so --development-mode never gets sourced

Autre31415 commented 6 years ago

As of right now there is an intentional security check in place that ignores the argument list when Roosevelt is started in an external environment.

The best way to solve this would be to ensure that unit tests always start Roosevelt apps inside of a forked process, to ensure there is no environmental pollution that effects the app. Once this is done we can strip out that check and this issue will be solved.