I'm creating an Angular 17 application with the angular cli.
Within the Angular application (served at 'http://localhost:4200
') I'm trying to access an mp3 file which resides on the Wamp64 server which I have running on my PC.
But I'm getting the following error:
Access to fetch at 'http://localhost/sarah/projects/app_assets/mp3s/01_Electronica.mp3'
from origin 'http://localhost:4200' has been blocked by CORS policy:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
If an opaque response serves your needs, set the request's mode to 'no-cors' to
fetch the resource with CORS disabled.
I found some simple instructions on google to resolve the error and I have followed them but it hasn't changed anything.
Here is a link to the instructions I followed:
Here's what I did (according to the instructions):
- I enabled the "
headers_module
" of the Apache modules. - Then in
httpd.conf
I added the code as per instructions in link above:
I'd appreciate any help or advice.
Thank you,
Sarah