Hello, im in a school project and we are developing a website in angular that uses an api in node.js and also uses a swi prolog server to do some algorithms , then the swi prolog uses the api to get information in the database to do the algorithm.
At this time everything is working fine the only error is when i try to comunicate from the spa to prolog server i get the error :
I have experienced similar messages form the web-browser, what i found out is that If the Swi-server does not give an answer at all, for example an empty answer or an error, that the Browser Always messages this as a CORS error which doesnt strictly has to be the case,
fetch() is the modern replacement for XMLHttpRequest(). There is an example of using fetch in my client code, which specifies the option mode: 'cors', so presumably you can turn off CORS with mode: 'no-cors'.
However, it’s really easy to have your server handle static requests (search for http_reply_from_files in my server code), so I’d recommend using that instead of disabling security features.