NEW
Font size
WorksheetsQuiz on Express JS and Routing
Total questions: 10
Worksheet time: 5mins
What is Express JS?
A programming language
A framework built on Node.js
A database management system
A web browser
What does a route handler do?
It creates new routes
It runs when a route is accessed
It manages database connections
It sends emails
Which HTTP method is used to submit a contact form?
GET
POST
PUT
DELETE
What does req represent in a route handler?
Response object
Database object
Request object
Router object
What is the purpose of route parameters?
To create user sessions
To manage database queries
To handle dynamic data in routes
To define static routes
What does the query string in a URL start with?
/
&
?
#
In the example app.get('/search', ...), what does req.query.name retrieve?
The category of the search
The URL path
The search term
The user's name
What is the output of app.get('/users/:id', ...)?
User ID is the value passed in the URL
User ID is undefined
User ID is a static number
User ID is 0
What does the app.get('/users/:id/profile', ...) example demonstrate?
Static routing
Combining route and query parameters
Error handling
Database interaction
What is the output when visiting http://localhost:3000/users/10?
User ID is 0
User ID is 10
User ID is 100
User ID is not found
