My Nuxt3 SSR app is currently AB testing.
AB testing pages are managed by num directory, and it will be deleted when AB testing finished.
But sometimes user visit old ab testing pages. So I want to redirect to the default page if it is not existing.
My App structure is like this.
pages
┣ ab
┃ ┣ 028
┃ ┃ ┣ [id].vue
┃ ┃ ┗ index.vue
┃ ┗ 029
┃ ┣ index.vue
┃ ┗ ranking
┃ ┗ index.vue
┣ index.vue
┣ [id].vue
┗ ranking
┣ index.vue
┗ [slug].vue
server
┗ middleware
┗ redirects.js
To redirect correct page, I need to get all app routes in server/middleware/redirect.js
.
How do I get routes?