Back to Expressjs

App Get Method

_includes/api/en/5x/app-get-method.md

latest377 B
Original Source
<h3 id='app.get.method'>app.get(path, callback [, callback ...])</h3>

Routes HTTP GET requests to the specified path with the specified callback functions.

{% include api/en/5x/routing-args.html %}

For more information, see the routing guide.

Example

js
app.get('/', (req, res) => {
  res.send('GET request to homepage')
})