Skip to content

Commit

Permalink
Update routing.md (#1397) (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdel101 authored Apr 9, 2024
1 parent e885be2 commit ef32d3d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions en/guide/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ app.get(/.*fly$/, (req, res) => {
})
```

<h3 id="route-parameters">Route parameters</h3>
<h2 id="route-parameters">Route parameters</h2>

Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The captured values are populated in the `req.params` object, with the name of the route parameter specified in the path as their respective keys.

Expand Down Expand Up @@ -280,17 +280,17 @@ app.get('/example/d', [cb0, cb1], (req, res, next) => {

The methods on the response object (`res`) in the following table can send a response to the client, and terminate the request-response cycle. If none of these methods are called from a route handler, the client request will be left hanging.

| Method | Description
|----------------------|--------------------------------------
| [res.download()](/{{ page.lang }}/4x/api.html#res.download) | Prompt a file to be downloaded.
| [res.end()](/{{ page.lang }}/4x/api.html#res.end) | End the response process.
| [res.json()](/{{ page.lang }}/4x/api.html#res.json) | Send a JSON response.
| [res.jsonp()](/{{ page.lang }}/4x/api.html#res.jsonp) | Send a JSON response with JSONP support.
| [res.redirect()](/{{ page.lang }}/4x/api.html#res.redirect) | Redirect a request.
| [res.render()](/{{ page.lang }}/4x/api.html#res.render) | Render a view template.
| [res.send()](/{{ page.lang }}/4x/api.html#res.send) | Send a response of various types.
| [res.sendFile()](/{{ page.lang }}/4x/api.html#res.sendFile) | Send a file as an octet stream.
| [res.sendStatus()](/{{ page.lang }}/4x/api.html#res.sendStatus) | Set the response status code and send its string representation as the response body.
| Method | Description |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [res.download()](/{{ page.lang }}/4x/api.html#res.download) | Prompt a file to be downloaded. |
| [res.end()](/{{ page.lang }}/4x/api.html#res.end) | End the response process. |
| [res.json()](/{{ page.lang }}/4x/api.html#res.json) | Send a JSON response. |
| [res.jsonp()](/{{ page.lang }}/4x/api.html#res.jsonp) | Send a JSON response with JSONP support. |
| [res.redirect()](/{{ page.lang }}/4x/api.html#res.redirect) | Redirect a request. |
| [res.render()](/{{ page.lang }}/4x/api.html#res.render) | Render a view template. |
| [res.send()](/{{ page.lang }}/4x/api.html#res.send) | Send a response of various types. |
| [res.sendFile()](/{{ page.lang }}/4x/api.html#res.sendFile) | Send a file as an octet stream. |
| [res.sendStatus()](/{{ page.lang }}/4x/api.html#res.sendStatus) | Set the response status code and send its string representation as the response body. |

<h2 id="app-route">app.route()</h2>

Expand Down

0 comments on commit ef32d3d

Please sign in to comment.