We have the server side ready, and now we need a user interface on the client side so we can send and fetch data. We will create three new pages in the /pages/users/ directory. This is our structure:
users
├── index.vue
├── _id.vue
├── add
│ └── index.vue
├── update
│ └── _id.vue
└── delete
└── _id.vue
As soon as we have the structure in place, we are ready to create pages and write the CRUD tasks from the Nuxt side (the client) in the following sections. Let's start with the create CRUD task in the next section.
Creating an add page for adding new users
We will create this page to communicate with the server-side POST route, /api/user/, to add a new user in the following steps:
- Create a form to collect the new user data in the <template> block as follows:
// pages/users...