mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Fixes #27109 This PR adds a default `agent` as described in the [`node-fetch` docs](https://github.com/node-fetch/node-fetch#custom-agent). We should see about 2x perf according to some [benchmarks](https://github.com/Ethan-Arrowood/undici-fetch/blob/main/benchmarks.md#fetch).
10 lines
246 B
JavaScript
10 lines
246 B
JavaScript
export default function SSR(props) {
|
|
return <pre id="props">{JSON.stringify(props)}</pre>
|
|
}
|
|
|
|
export async function getServerSideProps() {
|
|
const res = await fetch('http://localhost:44001')
|
|
const props = await res.json()
|
|
return { props }
|
|
}
|