I'm facing CORS issue in node version v8.9.4. Error is -
Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost:4200' is therefore not allowed
access.
At front end i'm using angular4 and have placed below code in my headers, but still facing issue.
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE,
OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-
Token');