Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

The Complete Guide to Data Fetching in Nuxt

Another Use Case for $fetch - in API Endpoints thumbnail image

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

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