Loading

Quipoin Menu

Learn • Practice • Grow

express-js / Express.js Routing Basics
mcq
Direction: Choose the correct option

Q1.

What is routing in Express.js?
A. The process of navigating between pages
B. The method to handle errors
C. The mechanism to define how an application responds to client requests at specific endpoints
D. The way to connect to a database
Direction: Choose the correct option

Q2.

Which Express method handles HTTP POST requests?
A. app.get()
B. app.put()
C. app.post()
D. app.delete()
Direction: Choose the correct option

Q3.

What is the correct syntax for a route that handles GET requests to '/about'?
A. app.route('GET', '/about', ...)
B. app.get('/about').then(...)
C. app.use('/about', (req, res) => { ... })
D. app.get('/about', (req, res) => { ... })
Direction: Choose the correct option

Q4.

What does the route app.all('/secret', ...) do?
A. It handles only POST requests
B. It handles only GET requests
C. It is invalid syntax
D. It handles all HTTP methods (GET, POST, PUT, etc.) for the path '/secret'
Direction: Choose the correct option

Q5.

Which object contains information about the incoming request?
A. app
B. next
C. res
D. req