(context)
| 21 | } |
| 22 | |
| 23 | export const getServerSideProps: GetServerSideProps<Props> = async (context) => { |
| 24 | const req = context.req as any |
| 25 | const res = context.res as any |
| 26 | |
| 27 | const version = req.context.currentVersion |
| 28 | |
| 29 | const searchVersion = searchVersions[Array.isArray(version) ? version[0] : version] |
| 30 | if (!searchVersion) { |
| 31 | // E.g. someone loaded `/en/enterprisy-server@2.99/search` |
| 32 | // That's going to 404 in the XHR later but it simply shouldn't be |
| 33 | // a valid starting page. |
| 34 | return { |
| 35 | notFound: true, |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | const mainContext = await getMainContext(req, res) |
| 40 | |
| 41 | return { |
| 42 | props: { |
| 43 | mainContext, |
| 44 | }, |
| 45 | } |
| 46 | } |
nothing calls this directly
no test coverage detected