Custom-type and routing

Hello Community,

I am building an application with Nextjs. I have created two custom types - page and dog_breed (both are repeatable types). 'page' custom type is called on root of pages folder in my Nextjs project on a file [uid].js. So the url for articles with custom type 'page' becomes - http://localhost:3000/article1 for example.

At the moment I am fetching the 'dog_breed' custom type by creating a folder named dog_breed inside pages folder in the Nextjs project. The dog_breed folder has a file named [uid].js which calls the dog_breed custom type. The url on frontend is - http://localhost:3000/dog_breed/dog1

Is there a way we can avoid /dog_breed from http://localhost:3000/dog_breed/dog1? So that the output url for articles which has a custom type 'dog_breed' becomes http://localhost:3000/dog1

Hope I could explain my question?

Thank you.

Hello @sean2, thanks for reaching out.
I don't believe this would be possible, because the file would require a different name e.g [dogs].js, and the Route Resolver would not understand this. But more than that, it's because NextJS won't have a way to differentiate each path from the other. Here's a related thread I found online that talks about this:

Okay,
Thank you