You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have hosted my nuxt project to vercel so it acts like a backend for my ionic app, to test the api calls I made this
consturl=ref('');consttryInternet=async()=>{// fetch data from url and return itdata.value=awaituseFetch(url.value).then((res)=>{console.log(res);returnres.data;}).catch((e)=>'error: '+e)};
// this uses pug, an html preprocessor.ion-padding
h1 {{ data }}
IonInput( v-model="url"placeholder="try")
IonButton( expand="block"@click="tryInternet") Get
using it locally from the same server localhost:3000 works fine:
when I tried hosting it to a backend and retrieving the data from localhost:3000 requesting from the server this comes:
馃攳 What have you tried?
I have tried the nuxt-proxy package but the issue was different, I wanted any host to be able to get data from the backend even though I knew this wasn't safe. the issue is that an ionic app doesn't have a web domain to tell the proxy to only send requests to this specific domain. so I didn't know how am I supposed to send to only my app.
鈩癸笍 Additional context
should I either send a request to only a specific domain somehow? how would I do this with nuxt ionic?
or should I make it accept requests from anywhere? and how can I tell the nuxt server to allow any server's requests?
The text was updated successfully, but these errors were encountered:
馃摎 What are you trying to do?
I have hosted my nuxt project to vercel so it acts like a backend for my ionic app, to test the api calls I made this
in the server api
server/api/count.js
:using it locally from the same server
localhost:3000
works fine:when I tried hosting it to a backend and retrieving the data from
localhost:3000
requesting from the server this comes:馃攳 What have you tried?
I have tried the
nuxt-proxy
package but the issue was different, I wanted any host to be able to get data from the backend even though I knew this wasn't safe. the issue is that an ionic app doesn't have a web domain to tell the proxy to only send requests to this specific domain. so I didn't know how am I supposed to send to only my app.鈩癸笍 Additional context
should I either send a request to only a specific domain somehow? how would I do this with nuxt ionic?
or should I make it accept requests from anywhere? and how can I tell the nuxt server to allow any server's requests?
The text was updated successfully, but these errors were encountered: