Skip to content

Commit a3344b9

Browse files
committed
docs(README.md): add description related to externalResolver option
related: #21, #32
1 parent 6f0599d commit a3344b9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,19 @@ This middleware is implemented using the [`http-proxy`](https://www.npmjs.com/pa
5959

6060
#### Example
6161

62-
- Refer to the following for how to use Nextjs API Middleware
62+
- Refer to the following for how to use Next.js API Middleware
6363

6464
- [Next.js API Middlewares Guide](https://nextjs.org/docs/api-routes/api-middlewares)
6565

6666
```ts
6767
// pages/api/[...all].ts
68-
...
68+
export const config = {
69+
api: {
70+
// Enable `externalResolver` option in Next.js
71+
externalResolver: true,
72+
},
73+
}
74+
6975
export default (req: NextApiRequest, res: NextApiResponse) => (
7076
isDevelopment
7177
? httpProxyMiddleware(req, res, {
@@ -83,6 +89,10 @@ This middleware is implemented using the [`http-proxy`](https://www.npmjs.com/pa
8389
: res.status(404).send(null)
8490
);
8591
```
92+
- `externalResolver` is an explicit flag that tells the server that this route is being handled by an external resolver. Enabling this option disables warnings for unresolved requests.
93+
- See the issues below
94+
- https://github.com/stegano/next-http-proxy-middleware/issues/32
95+
- https://github.com/stegano/next-http-proxy-middleware/issues/21
8696

8797
#### Using `multipart/form-data`
8898
* If you are using the `multipart/form-data`, refer to the Issues below

0 commit comments

Comments
 (0)