1.0.1 • Published 7 years ago
next-redirect v1.0.1
Redirect
Redirect for next.js. Works on both the client and server
Usage
static async getInitialProps (ctx) {
const [ err, course ] = await poss(loadCourse(ctx.query.course))
if (err) return redirect(ctx, '/')
return course
}
Installation
npm install next-redirect
License
MIT