In asp.net, I can use Server.MapPath("~/") to get the root path of my application. Is there any environment variable I can access via process.env or any other method to get the root path in node.js? I'm using iisnode.
Thanks
In asp.net, I can use Server.MapPath("~/") to get the root path of my application. Is there any environment variable I can access via process.env or any other method to get the root path in node.js? I'm using iisnode.
Thanks
There are more than one ways to do that:
__dirname
- The directory of the current module
__filename
- The full path to the current module
process.cwd()
- The working directory of the app