Which method in Express is used to handle HTTP GET requests to a specified route?

  • app.post()
  • app.get()
  • app.route()
  • app.put()
In Express, the app.get() method is used to handle HTTP GET requests to a specified route. This method is a part of the Express application instance (app) and is used to define routes that respond to HTTP GET requests. The other options (app.post(), app.route(), and app.put()) are used for handling other HTTP methods (POST, routing, and PUT) respectively.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *