dirname issue with Node.js

What is ‘__dirname’?

The **dirname in a node script returns the path of the folder where the current JavaScript file resides. **filename and __dirname are used to get the filename and directory name of the currently executing file.

When I use express.js as a backend, I faced some issues with ‘__dirname’.

Read More