Complete the code to serve static files from the 'public' directory using Express.
app.use(express.static('[1]'));
The express.static middleware serves files from the specified directory. Here, 'public' is the folder containing static files.
Complete the code to serve static files from the 'images' directory under the '/img' URL path.
app.use('/img', express.static('[1]'));
The express.static middleware serves files from the 'images' folder. The URL path '/img' maps to this folder.
Fix the error in the code to serve static files from both 'public' and 'assets' directories.
app.use(express.static('[1]')); app.use(express.static('assets'));
To serve multiple directories, call express.static for each folder. The first call should use 'public'.
Fill both blanks to serve static files from 'public' at root and 'uploads' at '/files'.
app.use(express.static('[1]')); app.use('/files', express.static('[2]'));
The first middleware serves 'public' at root. The second serves 'uploads' under '/files' URL path.
Fill all three blanks to serve 'public' at root, 'images' at '/img', and 'downloads' at '/dl'.
app.use(express.static('[1]')); app.use('/img', express.static('[2]')); app.use('/dl', express.static('[3]'));
Each express.static call serves a folder at the specified URL path.