04th
May
Express Js MCQ

Express Js MCQ

  • Admin
  • 04th May, 2023
  • 506 Followers

Express.js is a popular open-source web application framework for Node.js that simplifies the creation of web applications and APIs by providing a robust set of features and tools. It is fast, flexible, and scalable, and is used by developers to build a wide range of web applications and services. Finally, Practice here the most popular Express js Multiple Choice Questions with Answers.

Express Js MCQ with Answers

1) What is Express.js?

  • A. A client-side JavaScript framework
  • B.A database management system
  • C.A server-side JavaScript framework
  • D.None of the above

2) Which method is used to start a server in Express.js?

  • A. app.listen()
  • B.express()
  • C.app.use()
  • D.app.get()

3) Which package is used to install Express.js?

  • A. gem
  • B.pip
  • C.npm
  • D.composer

4) Which HTTP method is used to retrieve data in Express.js?

  • A. GET
  • B.PUT
  • C.POST
  • D.None of the above

5) Which method is used to handle a POST request in Express.js?

  • A. app.get()
  • B.app.put()
  • C.app.post()
  • D.None of the above
Download Free : Express Js MCQ PDF

6) Which method is used to handle a DELETE request in Express.js?

  • A. app.get()
  • B.app.delete()
  • C.app.post()
  • D.None of the above

7) Which method is used to handle a PUT request in Express.js?

  • A. app.get()
  • B.app.get()
  • C.app.put()
  • D.app.delete()

8) Which method is used to serve static files in Express.js?

  • A. app.get()
  • B.app.use()
  • C.app.post()
  • D.None of the above

9) Which method is used to set up middleware in Express.js?

  • A. app.post()
  • B.app.get()
  • C.app.use()
  • D.None of the above

10) What is the purpose of middleware in Express.js?

  • A. To connect to a database
  • B.To serve static files
  • C.To modify request and response objects
  • D.None of the above

11) What is the purpose of app.set() method in Express.js?

  • A. To serve static files
  • B.To set up middleware
  • C.To set application settings
  • D.None of the above

12) What is the purpose of app.locals in Express.js?

  • A. To store local variables
  • B.To store application settings
  • C.To store database connections
  • D.All of the above

13) Which module is used to parse HTTP request bodies in Express.js?

  • A. bodyParse
  • B.bodyParser
  • C.httpBodyParser
  • D.None of the above

14) What is the purpose of res.send() method in Express.js?

  • A. To send HTTP response with JSON data
  • B.To send HTTP response with status code 200
  • C.To send HTTP response with status code 404
  • D.To send HTTP response with custom status code

15) What is the purpose of res.json() method in Express.js?

  • A. To send HTTP response with JSON data
  • B.To send HTTP response with status code 200
  • C.To send HTTP response with status code 404
  • D.None of the above

16) Which method is used to set HTTP response headers in Express.js?

  • A. res.set()
  • B.res.send()
  • C.res.header()
  • D.res.headers()

17) What is the purpose of req.params object in Express.js?

  • A. To store HTTP request cookies
  • B.To store HTTP request headers
  • C.To store HTTP request body
  • D.To store HTTP request parameters

18) Which method is used to redirect a request in Express.js?

  • A. res.send()
  • B.res.redirect()
  • C.res.json()
  • D.None of the above

19) Which module is used to create a RESTful API in Express.js?

  • A. expressAPI
  • B.expressREST
  • C.restfulExpress
  • D.express.Router()

20) What is the purpose of req.cookies object in Express.js?

  • A. To store HTTP request cookies
  • B.To store HTTP request headers
  • C.To store HTTP request parameters
  • D.None of the above

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
Laravel MCQ
01st
Feb
Asp.Net MCQ
01st
Feb
PL/SQL MCQ
01st
Mar
C++  MCQ
01st
Apr
Flutter MCQ