Loading

Quipoin Menu

Learn • Practice • Grow

express-js / Built-in Middleware
mcq
Direction: Choose the correct option

Q1.

What does express.json() middleware do?
A. Parses incoming requests with JSON payloads
B. Serves static files
C. Parses URL-encoded bodies
D. Handles cookies
Direction: Choose the correct option

Q2.

What is the purpose of express.urlencoded({ extended: true })?
A. To parse URL-encoded bodies (form submissions)
B. To serve static files
C. To parse JSON
D. To enable CORS
Direction: Choose the correct option

Q3.

What is the difference between extended: true and extended: false in express.urlencoded()?
A. true parses JSON, false parses URL-encoded
B. true is for arrays, false is for strings
C. true uses the qs library (allows nested objects), false uses the querystring library
D. true enables strict parsing
Direction: Choose the correct option

Q4.

Which built-in middleware is used to serve static files like CSS and images?
A. express.public()
B. express.static()
C. express.file()
D. express.serve()
Direction: Choose the correct option

Q5.

How do you use express.static to serve files from a 'public' folder?
A. app.static('public')
B. app.use(express.static('public'))
C. app.mount(express.static('public'))
D. app.get(express.static('public'))