File size: 317 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import React from 'react'

export function Page({ page }) {
  return <p data-page={page}>{page}</p>
}

export function createGetServerSideProps(page: string) {
  return async function getServerSideProps(ctx) {
    const output = ctx.req.headers['x-invoke-output'] ?? null
    return { props: { page, output } }
  }
}