How can I determine if server.js is enabled or works directly, so I can export the server or just server.listen (port)?
thanks
From http://nodejs.org/docs/latest/api/modules.html#accessing_the_main_module
When a file is launched directly from Node, require.main is installed in its module. This means that you can determine if the file was run directly by testingrequire.main === module
When a file is launched directly from Node, require.main is installed in its module. This means that you can determine if the file was run directly by testing
require.main === module