mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
* Update to not show API not ended warning when response is piped to * Update to use res.once Co-authored-by: Joe Haddad <[email protected]>
11 lines
228 B
JavaScript
11 lines
228 B
JavaScript
import fetch from 'node-fetch'
|
|
|
|
export default async (req, res) => {
|
|
const dataRes = await fetch(
|
|
`http://localhost:${req.query.port}/api/query?hello=from-pipe`
|
|
)
|
|
|
|
res.status(dataRes.status)
|
|
dataRes.body.pipe(res)
|
|
}
|