-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssr-route.js
39 lines (31 loc) · 807 Bytes
/
ssr-route.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Index from '../components/pages/index'
import middleware, { preBuiltChain } from '../middleware'
import ssrImport from './api/ssrRoute/ssrImport'
export default function Home() {
return (<Index />)
}
async function getProps({ req, res }) {
console.info('SSR GET PROPS')
const responses = await Promise.all([
ssrImport(req, res),
])
console.info('Responses', responses)
return {
props: {
data: 'SSR Props Return',
}
}
}
// export const getServerSideProps = getProps
export const getServerSideProps = middleware()
.fnB()
// .unauthorized()
.skipRemainingMiddleware()
.fnD()
.fnA()
.decorate()
// .common()
.finish(getProps, 'SSR Import')
// export const getServerSideProps = preBuiltChain
// .fnD()
// .finish(getProps, 'SSR Import PreBuilt')