The Complete Guide to Data Fetching in Nuxt
Plans from $25/month

This lesson is for members. Join us?

Subscribe now and get immediate access to this course, 30 more and all future Vue.js courses!

Another Use Case for $fetch - in API Endpoints

In this lesson, we take a look at one more use case for $fetch , that is for making HTTP requests from a Nuxt API endpoint defined in server/api. You should NOT use useFetch or useAsyncData within your own Nuxt API endpoints but only $fetch. useFetch and useAsyncData should be reserved for use within composables and components.

Links