Page Redirection

  • Use h.redirect to redirect in the route
my-nodestack-app
├── src
│   ├── pages
│   │   │── redirect.js
│   ├── routes
│   │   │── redirect.js
├── ndsk.config.js
└── package.json
export default (props)=>{
    return (
        <html lang="en">
          <head>
            <title>redirect</title> 
          </head>
          <body> 
              {props.name}
          </body>
        </html>
      );
}
export default ({query:{id}},h)=>{
    if(id === '1'){
        return h.redirect('https://github.com/')
    }else{
        return {name:'this is redirect page'}
    }
}

Next

Error stack trace