Fetch all the possible paths to which routes exist
Answered
Cimarr贸n Uruguayo posted this in #help-forum
Cimarr贸n UruguayoOP
Is it possible to do this? Say for example you had a bunch of routes
Is it possible to get a
/login
, /posts/[slug]
, /logout
, etcIs it possible to get a
string[]
of these, where each list element represents the path?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
6 Replies
Its possible yeah.
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
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.
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