mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-21 19:41:33 +00:00
docs: change reference from v4 to v5 (#1914)
Change the api reference from v4 to v5 Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
This commit is contained in:
@@ -18,7 +18,7 @@ express.static(root, [options])
|
||||
```
|
||||
|
||||
The `root` argument specifies the root directory from which to serve static assets.
|
||||
For more information on the `options` argument, see [express.static](/{{page.lang}}/4x/api.html#express.static).
|
||||
For more information on the `options` argument, see [express.static](/{{page.lang}}/5x/api.html#express.static).
|
||||
|
||||
For example, use the following code to serve images, CSS files, and JavaScript files in a directory named `public`:
|
||||
|
||||
@@ -54,7 +54,7 @@ For best results, [use a reverse proxy](/{{page.lang}}/advanced/best-practice-pe
|
||||
{% endcapture %}
|
||||
{% include admonitions/note.html content=alert_content %}
|
||||
|
||||
To create a virtual path prefix (where the path does not actually exist in the file system) for files that are served by the `express.static` function, [specify a mount path](/{{ page.lang }}/4x/api.html#app.use) for the static directory, as shown below:
|
||||
To create a virtual path prefix (where the path does not actually exist in the file system) for files that are served by the `express.static` function, [specify a mount path](/{{ page.lang }}/5x/api.html#app.use) for the static directory, as shown below:
|
||||
|
||||
```js
|
||||
app.use('/static', express.static('public'))
|
||||
|
||||
Reference in New Issue
Block a user