78 | Note: This demo simulates a slow database or backend connection to 79 | demonstrate streaming. 80 |
81 | > 82 | ); 83 | } 84 | -------------------------------------------------------------------------------- /app/components/footer.tsx: -------------------------------------------------------------------------------- 1 | export function Footer({ children }: React.PropsWithChildren<{}>) { 2 | return ( 3 | 80 | ); 81 | } 82 | -------------------------------------------------------------------------------- /app/node/page.tsx: -------------------------------------------------------------------------------- 1 | import { Footer } from '../components/footer'; 2 | import { Region } from '../components/region'; 3 | import { Illustration } from '../components/illustration'; 4 | 5 | export const runtime = 'nodejs'; 6 | export const dynamic = 'force-dynamic'; 7 | 8 | async function getNodeData() { 9 | // `process.versions.node` only exists in the Node.js runtime, naturally 10 | const version: string = process.versions.node; 11 | const region = process.env.VERCEL_REGION; 12 | 13 | return { version, region }; 14 | } 15 | 16 | export default async function Page() { 17 | const { version, region } = await getNodeData(); 18 | const date = new Date().toISOString(); 19 | 20 | return ( 21 | <> 22 |