Nuxt API Routes

Lessons

1. Introduction

3:39

2. API Routes

4:54

3. Server Routes

4:45

4. RESTful Routes

5:05

5. Mutation Flow

9:04

Mutation Flow

In this lesson, we’ll add a Comment section in the Post Details Page. It will show a list of comments using the GET route, and it will go through a mutation flow to add new comments via the POST route and refresh the comments to show the new one.


Creating the Comment Section

We’re going to create the comment section in a new component.

📁 /components/CommentSection.vue

<scr