dh_demo

DreamHanks demo project
git clone git://git.lair.cx/dh_demo
Log | Files | Refs | README

index.tsx (588B)


      1 import { GetServerSideProps, GetServerSidePropsContext } from 'next'
      2 import Link from 'next/link'
      3 
      4 interface WikiPageProps {
      5   homePath: string
      6 }
      7 
      8 export const getServerSideProps: GetServerSideProps<WikiPageProps> = async (context) => {
      9   const homePath = `${context.resolvedUrl}/${process.env.WIKI_PAGE_ENTRY}`
     10 
     11   return {
     12     redirect: {
     13       destination: homePath,
     14     },
     15     props: {
     16       homePath
     17     }
     18   }
     19 }
     20 
     21 export default function WikiPage (props: WikiPageProps) {
     22   return (
     23     <div>
     24       <Link href={props.homePath}>여기</Link>를 눌러 이동하세요.
     25     </div>
     26   )
     27 }