Configure Angularjs and CORS correctly using Apache running Flask api and Angularjs frontend on separate domain Configure Angularjs and CORS correctly using Apache running Flask api and Angularjs frontend on separate domain flask flask

Configure Angularjs and CORS correctly using Apache running Flask api and Angularjs frontend on separate domain


I was able to solve this problem and it was the stupidest thing. I will dig up the other stackoverflow posts that helped lead me to the solution. But basically during testing I generated self signed certificates to use locally. Apparently both firefox and chrome will automatically cancel your requests if it does not trust the certificates when doing cross domain posts. I had to go into both chrome and firefox to add the certificates and mark them as trusted before they stopped cancelling the request. Now everything works perfectly.

Also in this investigation I found out that you do not need to add into Flask the requests helper to add headers to your responses and in your Apache configuration. If you put them in both it will add headers both times. In my configuration I chose to add it to my Apache configuration because it made my python code alot cleaner.