How to make routes like this api/users/${userID}/${userDbID} using nuxt

Viewed 24

If I am making an api for fetching user posts data and i want to have a route like api/users/${userID}/${userDbID} How can I make these kind of routes using NUXT?

2 Answers

What I understand from the asked question that you understand the following topics

1- NUXT Application repository structure to represent its components and service interfaces

2- Point 1 will give the pointer how will you control the application routes to serve components views, application pages, layout and other required resources.

hint: Nuxt auto-creates the application route against each .vue file that exists in Pages folder.

You might want to manage the states of Application component data which you referred as 'User'- Please explore a bit further how states declaration & its management works in NUXT defined application, and how would you map services routes with the expected functionality for the application. This will evolve your application to apply action, mutations etc with the context of the User user/:userid/...

Related