Courses

The Complete Guide to Data Fetching in Nuxt - The Complete Guide to Data Fetching in Nuxt - 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