get all available routes
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
how do i get all the available routes? want to list them out
7 Replies
What do you mean??
@Muhammed Khal What do you mean??
Polar bearOP
lets say i have a home page, abouts page, i want to get ['/', '/about']
@Polar bear lets say i have a home page, abouts page, i want to get ['/', '/about']
nextjs doesn't have that interface exposed iirc, you can only get their types
you can always do
import type { AppRoutes } from "@/../.next/dev/types/routes"
export const appRoutes = {
// let the error notifies you have missing route
} satisfies Record<AppRoutes, ''>@Polar bear can i not do something like this?
https://www.sveltepatterns.dev/how-to-get-all-routes
thats just manually reading the folder...
you can always do that