Loading...
QUIZ

Certification Test

 
Que No. 1 ) How can you install a third-party middleware in Express.js?

A.) Using the npm install middleware-name command and then importing it
B.) By downloading it from the Express.js website
C.) By copying and pasting the middleware code into your application
D.) Express.js does not support third-party middleware


Que No. 2 ) What is the primary role of an Express.js "router" object?

A.) To define URL patterns and mapping them to functions
B.) To serve static files
C.) To configure SSL certificates
D.) To manage database connections


Que No. 3 ) What is the role of the app.use() method when used with a router in Express.js?

A.) To serve static files
B.) To start the router
C.) To mount the router at a specified path
D.) To configure SSL certificates


Que No. 4 ) Which Express.js middleware is often used for handling authentication tokens (e.g., JWT)?

A.) jwt-middleware
B.) express-auth-token
C.) passport-jwt
D.) token-parser


Que No. 5 ) What is the purpose of the app.route() method in Express.js?

A.) To define a new route
B.) To define a middleware function for a specific route
C.) To configure SSL certificates
D.) To serve static files


Que No. 6 ) In Express.js, what is a "response status code"?

A.) A code that specifies the HTTP method used
B.) A code that indicates the success or failure of an HTTP request
C.) A code that defines the content type of the response
D.) A code that identifies the client making the request


Que No. 7 ) What is the primary role of the res object in Express.js middleware?

A.) To configure SSL certificates
B.) To represent the HTTP request
C.) To send an HTTP response
D.) To define URL patterns


Que No. 8 ) What is Express.js' middleware used for handling cross-origin resource sharing (CORS)?

A.) express-cors
B.) cors-handler
C.) cross-origin-middleware
D.) express-cross-origin


Que No. 9 ) What is the purpose of the app.locals object in Express.js?

A.) To configure SSL certificates
B.) To store application-wide data accessible to all views and middleware
C.) To define URL patterns
D.) To serve static files


Que No. 10 ) What is Express.js' "template engine" used for?

A.) To serve static files
B.) To render dynamic web pages using templates
C.) To configure SSL certificates
D.) To define URL patterns