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
Hi, so I was on the right path. exactly there I wanted to add the cross_origin but I was not sure, if the mistake is not my request itself. I tried to make an ajax request.
first of all i created the container a bit different, because I want to make the request from another docker container, so i created the container like
docker run -it -p "0.0.0.0:8080:80" jgontrum/spacyapi:en_v2
I have a nodejs container, where my application is hosted on. the request is done from a javascript
$.ajax({
type: "PUT",
url: "http://:8080/ent",
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
"text": "When Sebastian Thrun started working on self-driving cars at Google in 2007, few people outside of the company took him seriously.",
"model": "en"
}),
dataType: 'json',
async: true,
success: function() {
console.log("success");
},
error: function() {
console.log("error");
}
});
I think the request should be right. and the error which is given is:
Access to XMLHttpRequest at 'http://<my_ip>:8080/ent' from origin 'http://<my_ip>:<nodejs_port>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I‘m getting an error (Cross origin) when I am doing a request from another container. How can I enable cors?
The text was updated successfully, but these errors were encountered: