How to call Foreman puppet api from another web application?

I am trying to call foreman API from other different domain. But always getting cors origin error.
Using ajax and angular but both send the same error. Any help please.

Actual error:
Access to XMLHttpRequest at ‘’ from origin ‘http://localhost:4200’ 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.

Angular Code:

public getReport(){
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type':  'version=2,application/json',
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Headers': 'Origin, Content-Type, X-Auth-Token',
        'Access-Control-Allow-Methods': 'GET,POST,OPTIONS,DELETE,PUT',
        'Authorization': 'Basic ' + btoa('admin:Test123@')
    return this.httpClient.get<object[]>('', httpOptions); 

Finally, I found solution. So I have to set cors with foreman-installer.

foreman-installer --foreman-cors-domains http://localhost:4200 /* Your domain name*/