Express Framework Test 1 — Questions and Answers
Question 1: Cookies are huge, complicated files/data that are transmitted to the server with a client request and stored on the server.
- It can be true or false
- Cannot say
- This statement is true
- This statement is false (Correct answer)
Correct answer: This statement is false
Explanation: <br> Cookies are tiny files/data delivered to the client as part of a server request and kept on the client's computer. As a result, the statement in the question is incorrect.
Question 2: What does the term "backlogs arguments" imply?
- A synchronous function that is called when the server starts listening for request
- A port number on which the server should accept incoming request
- Namer of the domain
- The maximum number of queued pending connection (Correct answer)
Correct answer: The maximum number of queued pending connection
Explanation: <br> The backlog is the total number of outstanding connections that are queued. 511 is the default.
Question 3: Root paths determine the endpoints at which requests can be made when used in conjunction with request methods. <br> Which of the following is a proper route path form?
- string patterns
- regular expressions
- string
- all of the above (Correct answer)
Correct answer: all of the above
Explanation: <br> All of the above are the proper route path forms.
Question 4: Who is credited for creating Express.js?
- Rob Pike
- Larry wall
- Rich Hickey
- TJ Holowaychuk (Correct answer)
Correct answer: TJ Holowaychuk
Explanation: <br> Express.js is credited to TJ Holowaychuk as its creator.
Question 5: Which of the following characteristics of the Express framework are essential?
- It is used to render the HTML pages dynamically.
- It allows us to set up middleware to respond to HTTP Requests.
- It defines a routing table that can work as per HTTP Method and URL.
- All of the above. (Correct answer)
Correct answer: All of the above.
Explanation: <br> The Express framework's key features are all of the above.
Question 6: The function app.all (path, callback [, callback...]) in express.js is:
- Cannot say
- True (Correct answer)
- False
- None of the above
Correct answer: True
Explanation: <br> The statement is true
Question 7: Express.js was first launched in which of the following years?
- November 2011
- November 2010 (Correct answer)
- December 2011
- December 2010
Correct answer: November 2010
Explanation: <br> In November of 2010, Express.js was first released.
Question 8: In Express.js, how do you make chainable route handlers for a route path?
- Using app.router()
- Using app.routing()
- Using app.route() (Correct answer)
- Using app.routes()
Correct answer: Using app.route()
Explanation: <br> We may make chainable route handlers for a route path in Express.js by utilizing the app.route() method.
Question 9: What's the best approach to save local variables that can be accessible from within the app?
- Using app.storage
- Using Config file
- Using database
- Using app.locals (Correct answer)
Correct answer: Using app.locals
Explanation: <br> By using app.locals, we may save local variables that can be retrieved from within the app.
Cookies are huge, complicated files/data that are transmitted to the server with a client request and stored on the server.