Express Static Flashcards
1
Q
What is the purpose of the Express Static middleware?
A
sends files within the root provided to build a server with multiple locations
To serve static files such as images, CSS files, and JavaScript files,
2
Q
What does express.static() return?
A
use() function executes middleware in order. The express. static() middleware returns an HTTP 404 if it can’t find a file,
3
Q
What are several examples of static files?
A
images, JavaScript files, CSS files, videos, Flash files, even web pages
4
Q
What is a good way to serve application images using Express?
A
To serve static files such as images, CSS files, and JavaScript files, use the express.static built-in middleware function