Answer the question
In order to leave comments, you need to log in
How to make Angulajs and Yii2 REST API on the same web server?
Good afternoon!
I am developing an application on Angularjs and Yii2 Rest API.
Now I'm running the application through webpack on the same machine I'm developing on. The Yii2 Rest API server runs on nginx on another machine, so I had to add the following lines to the nginx config:
add_header Access-Control-Allow-Origin "http://localhost:4200";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Keep-Alive,Content-Type";
add_header Access-Control-Expose-Headers "Content-Type";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question