N
Nuxt2y ago
nandi95

data fetching prefixed with localhost

why all my data fetching calls prefixed with localhost? https://stackblitz.com/edit/nuxt-starter-ec7q6b?file=app.vue
StackBlitz
Nuxt - Starter (forked) - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
1 Reply
nandi95
nandi952y ago
oh that doesn't include the code just stick this into the app.vue
<script lang="ts" setup>
const { data } = useFetch('www.thecocktaildb.com/api/json/v1/1/random.php', { server: false });
console.log(data.value);
</script>
<script lang="ts" setup>
const { data } = useFetch('www.thecocktaildb.com/api/json/v1/1/random.php', { server: false });
console.log(data.value);
</script>
it seems the request seems to be going to: https://nuxtstarterec7q6b-aczb--3000.local-corp.webcontainer.io/www.thecocktaildb.com/api/json/v1/1/random.php it's the missing protocol 🤦
Want results from more Discord servers?
Add your server