Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Learn how to Build a REST API with Next.js 13. In this tutorial, we will build a REST API with 5 API endpoints. We will also look at when you want to use an API in your Next.js application and when you don't.

⭐ Become a full-stack web dev with Zero To Mastery Courses:
- Complete Next.js Developer: https://bit.ly/CompNextJSDev
- Advanced React: https://bit.ly/AdvReactDev
- Junior to Senior Dev Roadmap: https://bit.ly/WebDevRoadmap-JrtoSr

Subscribe https://bit.ly/3nGHmNn

Course Updates https://courses.davegray.codes/

Questions - Please post them to my Discord https://discord.gg/neKghyefqh

Buy Me A Coffee https://www.buymeacoffee.com/davegray

Follow Me On Social Media:
Github: https://github.com/gitdagray
Twitter: https://twitter.com/yesdavidgray
LinkedIn: https://www.linkedin.com/in/davidagray/

Source Code: https://github.com/gitdagray/next-js-course

Playlist for this Next.js Course: https://bit.ly/dg-nextjs

How to Build a REST API with Next.js 13

(00:00) Intro
(00:05) Welcome
(00:25) Next.js New Route Handlers
(00:43) When to use API Routes for your app & when not to
(02:24) Create a new project & Next 13.3 changes
(05:15) Environment variables & API keys
(07:51) GET route handler
(12:43) DELETE route handler
(18:34) POST route handler
(21:55) PUT route handler
(26:03) Dynamic API route
(29:57) Next steps

Tutorial References:
Next.js Official Site: https://nextjs.org/
Next.js 13 Beta Docs: https://beta.nextjs.org/docs
ES7 React Snippets Extension: https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets

Was this Next.js tutorial about how to build a REST API helpful? If so, please share. Let me know your thoughts in the comments.

#nextjs #rest #api