rsnext/test/integration/api-support/pages/api/test-res-pipe.js

11 lines
228 B
JavaScript
Raw Normal View History

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)
}