Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion legacy/en/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ You can find the list of available codemods [here](https://codemod.link/express)
<li><a href="#res.send.body">res.send(body, status)</a></li>
<li><a href="#res.send.status">res.send(status)</a></li>
<li><a href="#res.sendfile">res.sendfile()</a></li>
<li><a href="#res.sendFile.options">res.sendFile() and express.static() options</a></li>
<li><a href="#router.param">router.param(fn)</a></li>
<li><a href="#express.static.mime">express.static.mime</a></li>
<li><a href="#express:router-debug-logs">express:router debug logs</a></li>
Expand Down Expand Up @@ -352,7 +353,6 @@ The `res.sendfile()` function has been replaced by a camel-cased version `res.se
- CSS files (.css): now "text/css" instead of "text/plain"
- XML files (.xml): now "application/xml" instead of "text/xml"
- Font files (.woff): now "font/woff" instead of "application/font-woff"
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"

{% capture codemod-camelcase-sendfile %}
You can replace the deprecated signatures with the following command:
Expand All @@ -376,7 +376,12 @@ app.get("/user", (req, res) => {
res.sendFile("/path/to/file");
});
```
<h3 id="res.sendFile.options">res.sendFile() and express.static() options</h3>

The following options to the `res.sendFile()` and `express.static()` functions are no longer supported:

* `hidden`: Use the `dotfiles` option instead. Note that the default value of `dotfiles` is now `"ignore"`.
* `from`: Use the `root` option instead.
<h3 id="router.param">router.param(fn)</h3>

The `router.param(fn)` signature was used for modifying the behavior of the `router.param(name, fn)` function. It has been deprecated since v4.11.0, and Express 5 no longer supports it at all.
Expand Down