How to check whether the server is running locally or on a VPS?

You need to check the environment where the server is running ?
Will it be enough to check the type HOST !== '0.0.0.0' means no localhost ?
NODE_ENV can not be verified as it can be run locally in production.
April 3rd 20 at 17:19
1 answer
April 3rd 20 at 17:21
Solution
NODE_ENV can not be verified as it can be run locally in production.

Create another variable and pass it in the environment when the application starts.

Find more questions by tags Node.js