Issue: The angular application was getting error from API that the origin has been blocked by CORS policy.
Solution: Make sure that the url configured in angular (usually in environment.ts file missing http or https). Example below:
Error Configuration:
export const environment = {
production: false,
apiUrl: 'localhost:56425/api'
};
Correct configuration:
export const environment = {
production: false,
apiUrl: 'http://localhost:56425/api'
};
Solution: Make sure that the url configured in angular (usually in environment.ts file missing http or https). Example below:
Error Configuration:
export const environment = {
production: false,
apiUrl: 'localhost:56425/api'
};
Correct configuration:
export const environment = {
production: false,
apiUrl: 'http://localhost:56425/api'
};