Hi, i have a problem with cors policy. the problem is that I’m with localhost in both servers (front and back) the problem is that i get that error only with chat component.
I put the url in other component and works fine. I used postman to send a req and i get the response. Only with the component i get the error of cors policy.
Also I tried to put my token auth headers and didn’t work.
this is my code
import { JetView, JetApp } from “webix-jet”;
export default class windowChat extends JetView {
config() {
const chatView = {
view: "chat",
url: `localhost:3000/chat`,
calls: true,
};
let body = {
rows: [
chatView
]
};
return {
view: "window",
localId: "win",
body: body,
};
}
init(view) {
webix.attachEvent("onBeforeAjax",
function(mode, url, data, request, headers, files, promise){
headers["authorization"] = 'token';
}
);
}
}