- I am having an issue in my project, I understand the error, as well as I tried to find answer for it but no luck so far.
Here is my scenario
-
I have nuxt 3 app, where I am embedding one of the vue component.
-
That component is a chatbot, where user can ask some question to it.
-
I have no control or no way to access method or API call it make to get chat response, which is giving me error as, that api call origin is different.
-
How can solve this cors error.
-
My app is running on,
localhost:3000
and request are made by that component is something likehttps://part1.part2.part3.origin.com/log
andhttps://part1.part2.part3.origin.com/api/chat
-
How to solve cors error in this senario.
-I have below config code in nuxt.config.js
file.
vite: {
server: {
proxy: {
'/APPWEB/': {
target: 'http://localhost',
changeOrigin: true,
secure: false
},
'/APPWEB/Lib/': {
target: 'http://localhost',
changeOrigin: true,
secure: false
}
}
}
}
- Please guide me how to solve this issue and if needed please update quetion title.