Skip to content

Redirect Middleware

Juan J. Ramirez requested to merge jj-ramirez/redirect-middleware into master

In order to merge !1669 (closed) we need to set up redirections in https://design.gitlab.com.

This is probably good not only for 1669, but probably will be used down the road when other content starts to evolve and change.

I explored different options on how to set up the redirection on Nuxt but the only simple solutions were to actually set the redirections ad-hoc in the components (since this is a wrapper of Vue's router-link).

But since this is a catch-all type of situation, I had to go with a more complex solution a write a redirect middleware from scratch. This is the recommended approach (https://nuxtjs.org/api/pages-middleware/)

This middleware doesn't cover super complex use-cases, but it does cover the core use cases we have right now for redirections. We can improve this later if we start seeing a need for more complex redirections.

Merge request reports