How to enable 'Access-Control-Allow-Origin' header for all files in a directory of XAMPP?

后端 未结 2 1123
旧巷少年郎
旧巷少年郎 2021-02-12 11:30

I am developing a HTML5 Javascript app to get an image from my local server which runs on the same machine as the app. When I run the app on my Chrome, I got:

2条回答
  •  不知归路
    2021-02-12 11:54

    Create a file called ".htaccess" in the directory of your files and add the following to the file.

    Header set Access-Control-Allow-Origin "http://localhost:50000/"
    

提交回复
热议问题