Identify entrypoint file in node.js application using Passenger

Viewed 45

My shared host uses Plesk with Phusion Passenger to run node.js applications. I've noticed that require.main.filename does not resolve to the application entrypoint configured by the user but to passenger's node-loader (/usr/share/passenger/helper-scripts/node-loader.js) in this environment. So how can you identify the node.js application entrypoint when running with Passenger?

I've already tried using this shim https://www.npmjs.com/package/require-main-filename but unfortunately it returned the same node-loader file.

0 Answers
Related