Koa.js Redirects - Koa.js

What is Koa.js Redirect?

Koa Redirect plays an important role in the process of website creation. Koa.js facilitates in redirecting server errors and malformed URL request to the respective error pages. Koa redirect enables to keep people away from the restricted areas of website. With an illustration, we will understand creation of error page and redirect the page.

When the code runs, other than '/hello', the page will be redirected to ‘/not found’. The middleware is placed at the end,

so that middleware is reached last and the corresponding response is sent.

When the above code runs, the message appears as:


If navigated to other routes, then the message appears as:


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Koa.js Topics