Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Effectively Build RESTful APIs using Next.js API Routes

via egghead.io

Overview

Building an API might be an intimidating process, especially if you are starting to learn how to design your backend application.
You might find yourself asking how to design for performance? or how do you even create a consistent API?
RESTful APIs allow you to improve scalability, are cacheable and flexible.
API Routes are one of the most powerful features in Next.js because they let you build backend APIs without needing to create a custom server or spin up a new project/service. This eliminates the need to develop the backend for your application in another repository, which means less code, and less code means fewer bugs!
With this course, you will understand how to call handle different HTTP verbs for their RESTful APIs in Next.js as well as learn that Next.js is a viable option to create RESTful APIs.
With that said, after this course, you'll also learn and understand that having one file per route is okay, and each API route in Next.js is serverless, which means the concept of state doesn't exist.
Gain these skills:
Add middleware with next-connect
Understand the concept of middleware and how it affects requests
Refactoring RESTful APIs
How to call APIs in React/Next.js
Use dynamic routes

Syllabus

  • Create a Static REST Endpoint in Next.js
  • Create a Dynamic Next.js API route
  • Create a Catch All Next.js API route
  • Create an Optional Catch-All API Route in Next.js
  • Handle Different HTTP Verbs in a Next.js API Route
  • Add a Middleware to a Next.js API Route
  • Create an API Route Using the next-connect Package
  • Add Middleware to an API Route Created with next-connect
  • Hide Sensitive Information from the Consumers of Next.js API

Taught by

Alejandro Ñáñez

Reviews

4.2 rating at egghead.io based on 84 ratings

Start your review of Effectively Build RESTful APIs using Next.js API Routes

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.