CORS problem

Hello Community,

Ive been trying to consume the Bonita rest API from another domain, I followed the documentation to enable CORS in Bonita Server and used the example that appear here:

When the page load I get the following error:

How to enable cors in Bonita Tomcat ?

Hi ,

are there any file in bonita folders , that it allow me to change anything in order to comunicat with API REST, because i have this error:

XMLHttpRequest cannot load http://localhost:8080/bonita/loginservice. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.

Also i have to say that when i put this code :