Next.js Discord

Discord Forum

Fetch all the possible paths to which routes exist

Answered
Cimarr贸n Uruguayo posted this in #help-forum
Open in Discord
Avatar
Cimarr贸n UruguayoOP
Is it possible to do this? Say for example you had a bunch of routes /login, /posts/[slug], /logout, etc

Is it possible to get a string[] of these, where each list element represents the path?
Image
Answered by Jboncz
https://github.com/DiiiaZoTe/next-route-visualizer Heres a concept to follow, its not quite up to date, not sure if it works on nextjs14 but its a really good starting point
View full answer

6 Replies

Avatar
Its possible yeah.
Avatar
https://github.com/DiiiaZoTe/next-route-visualizer Heres a concept to follow, its not quite up to date, not sure if it works on nextjs14 but its a really good starting point
Answer
Avatar
There is nothing out of the box that returns all this, but thats the way the build steps work, it has to find all of this out to build it all, you just need something that finds the data but doesnt do the building... thats the nutshell explanation of it 馃檪 Not quite that simple but its a start.
Avatar
Cimarr贸n UruguayoOP
oh it reads the file structure
i was hoping nextjs exposes a list of endpoints of the app 馃槄
thanks for the link tho appreciate it