'How to rename parent path in NextJS dynamic routing

I’m able to use NextJS dynamic routing to build pages. Currently I have the file structure as photo. The url /apps shows many apps, /apps/123 shows the app detail for a single app.

But I want to turn /apps/123 to /app/123, and keep everything else the same. How to achieve that in NextJS?

Photo of the file structure



Solution 1:[1]

You have to rename the folder apps as app. That will change the routes too.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tushar Shahi