express-static Flashcards
1
Q
What does express.static() return?
A
It returns a middleware function that serves static files from a directory specified as the first argument.
2
Q
What is the local __dirname variable in a Node.js module?
A
__dirname is a global variable in Node.js that represents the directory name of the current module. It gives you the absolute path of the directory containing the current module file.
3
Q
What does the join() method of Node’s path module do?
A
used to join multiple path segments into a single path. It takes one or more string arguments, which represent the parts of the path, and concatenates them, adding the appropriate directory separator (/