next.js/test/integration/fetch-polyfill/pages/api/api-route.js
api-route.js7 lines216 B
export default async function ApiRoute(_req, res) {
  const port = process.env.NEXT_PUBLIC_API_PORT
  const response = await fetch(`http://localhost:${port}/`)
  const json = await response.json()
  res.json(json)
}
Quest for Codev2.0.0
/
SIGN IN