I'm following this project angular2-authentication-sample for angular2 js for authentication. I'm getting this problem Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8000/api/auth/register. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). when requesting to an signup endpoint.
I check different question and i added extra header in headers.
headers.ts
import { Headers } from '@angular/http';
export const contentHeaders = new Headers();
contentHeaders.append('Accept', 'application/json');
contentHeaders.append('Content-Type', 'application/json');
contentHeaders.append('Access-Control-Allow-Origin', '*');
contentHeaders.append('Access-Control-Request-Method', '*');
contentHeaders.append('Access-Control-Allow-Methods', '');
contentHeaders.append('Access-Control-Request-Headers', 'Origin, Content-Type, Accept');
I'm not able to slove this CROS problem.