Skip to content
Merged
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
12 changes: 12 additions & 0 deletions src/content/pages/en/guide/migrating-5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ This check only applies to the part of the path that `send` evaluates. When you

#### How to update

You can automatically update your code by running the following command:

<PackageManagerCommand command="npx codemod@latest @expressjs/sendfile-options" />

Or you can update your code manually:

```diff
app.get('/files/:name', (req, res) => {
- res.sendFile(req.params.name, { hidden: true, from: '/uploads' });
Expand Down Expand Up @@ -327,6 +333,12 @@ Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work wit

#### How to update

You can automatically update your code by running the following command:

<PackageManagerCommand command="npx codemod@latest @expressjs/static-mime" />

Or you can update your code manually:

```diff
-express.static.mime.lookup('json');
+const mime = require('mime-types');
Expand Down
Loading