In this video, we will create Next.js API Routes using next-connect. We will also show how to have middleware using next-connect for authentication and authorization.

Next-connect has an API similar with express.js which feels familiar to most of us =)

Timeline:

  • 00:00 Introduction
  • 01:43 Show database structure
  • 02:06 Show /api/champions using POSTMAN working for all methods
  • 02:31 Show /api/drivers using switch/case
  • 03:00 Use next-connect for /api/champions
  • 04:44 Setup onNoMatch in next-connect
  • 06:00 Setup onError in next-connect
  • 07:52 Share next-connect handlers across our api routes
  • 08:42 Move from switch/case to next-connect
  • 10:24 Middleware for authentication and authorization
  • 19:48 Conclusion

Git Repository: https://github.com/bmvantunes/youtube-2020-july-next-api-routes-next-connect

#next #react #api #javascript #programing

Next.js API Routes using next-connect
53.70 GEEK