rsnext/test/integration/api-support/pages/api/external-resolver.js
Pablo Saez dac715e8f7
Add flag to disable API warning (#11380)
* Add flag to disable API warning

This flag is useful when you are using an external API resolver like express when defining an API route, since the native functionality doesn't realize that the API actually sent a response.

A very simple use case example https://github.com/PabloSzx/next-external-api-resolver-example

fixes #10589

* Update api-middlewares.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-05-07 14:05:41 +02:00

11 lines
171 B
JavaScript

export default (_req, res) => {
setTimeout(() => {
res.send('hello world')
}, 0)
}
export const config = {
api: {
externalResolver: true,
},
}