index.tsx (631B)
1 import { GetServerSideProps } from 'next' 2 import Link from 'next/link' 3 4 export interface IndexPageProps { 5 homePath: string 6 } 7 8 export const getServerSideProps: GetServerSideProps<IndexPageProps> = async (context) => { 9 const homePath = `/wiki/${process.env.WIKI_HOME_WIKI}/${process.env.WIKI_PAGE_ENTRY}` 10 return { 11 redirect: { 12 destination: homePath, 13 }, 14 props: { 15 homePath 16 } 17 } 18 } 19 20 export default function IndexPage (props: IndexPageProps) { 21 return ( 22 <div> 23 페이지가 나타나지 않는 경우, 24 <Link href={props.homePath}>여기</Link>를 눌러 이동하세요. 25 </div> 26 ) 27 }