I'm building angular 2 application with following proxy configurations.
proxy.conf.json
{
"/": {
"target": "http://localhost:6060",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}}
I used spring boot application as my back end and it is running at port 6060
My package json's build scripts are as follows
package.json
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
When I use npm start , the application works fine. All back end requests are sent to http://localhost:6060
Then I build production version using
ng build --prod --proxy-config proxy.conf.json
and deploy the generated code to HTTP sever (apache server). Then I visit to http://localhost/ the application stats. But when I try to make requests, those are pointed to http://localhost/... not to http://localhost:6060
I try to find some solutions but non of those works. Please give me some help.
thanks