'How to set next js custom path when user have multitenant

I want to make an application for offering multi tenant. I don’t know the word(multi tenant) is correct. For example, A user have one userId as (hey188) The user can have below 3 paths that used for url as (apple, grape, hotdog.. and so on) The user can have a lot of menu and submenu. so we want to present this path and menu in url. For example,

www.domain.com/apple/buy/buydetail
www.domain.com/grape/buy/buylist
www.domain.com/hotdog/buy/buylist

How to set the path apple/grape/hotdog in Next.js ?

Because apple/grape/hotdog are not page. And apple/grape/hotdog data are called by api. But buydetail/buylist are page.

And we should validate whether the user have correct path when user lend page.

www.domain.com/orange/buy/buylist 

I can not find the way to set this path and router.

Please let me know. Thank you so much!



Sources

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

Source: Stack Overflow

Solution Source