In Express.js, which method is used to define a route that should respond to HTTP GET requests?
- app.post()
- app.get()
- app.put()
- app.delete()
In Express.js, the app.get() method is used to define a route that should respond to HTTP GET requests. It is used to handle GET requests for a specific URL path. The other options (app.post(), app.put(), and app.delete()) are used for different HTTP methods.
Loading...
Related Quiz
- What is the default behavior of Express when an error occurs in a middleware?
- The ______ property of the request object in the http module contains the HTTP method of the request.
- In a RESTful API, which HTTP method corresponds to the Update operation in CRUD?
- Which of the following is the primary goal of input sanitization?
- What is the main difference between SQL and NoSQL databases regarding data structure?