app.vue
<script setup lang="ts"> const { data } = await useFetch('http://localhost:1337/api/books') // replace by your api url </script> <template> <pre>{{ JSON.stringify(data) }}</pre> </template>
Please refer to the nuxt documentation :