Do you know that you can easily create an API with Nuxt? Today we are going to do a simple API with Nuxt 3 Server Routes and consume them from the Frontend using Data Fetching composable like useFetch.
Let me know in the comments if you have any questions.
Come say hi on Twitter https://twitter.com/alvarosabu
Our Sponsors
Meet Storyblok (not Storybook that is a different thing) The world's first headless CMS that works for both developers & business users.
I must warn you when you start using it, you will never go back to any other CMS solution
Give it a try at https://t.co/aaEZxcPC4W 😜
00:00 - Intro
00:15 - Marker 2
00:49 - Nuxi init
01:23 - Creating a single server route
03:11 - Create route that returns JSON data
05:46 - Creating a page
06:43 - Data fetching with useFetch
07:54 - Pokedex page layout and styles
12:28 - Pending and error with useFetch
20:20 - Using query parameters
24:05 - Post route (Submit a form)
28:31 - Outro