Problem Statement: Client/UI developed using angular-cli and Angular-5, UI is running on http://localhost:4200 and we have back-end server running on http://localhost:8000 that means all api's called like http://localhost:8000/users/getuserinfo and returns some json data properly. Also having other routes like http://localhost:8000/student/getresult etc.
So i have to create proxy for this as when i run ng serve
my application open-up in browser on http://localhost:4200, but while making call to api's url forms like http://localhost:4200/users/getuserinfo which return result like 404 i.e. not found, but when i hit url in another tab for http://localhost:8000/users/getuserinfo, it returns me json data.
So i need to create proxy for http://localhost:4200/users/getuserinfo to like as http://localhost:8000/users/userinfo. I tried to implement using DOCS but not succeeded and also dont know how get all apis in proxy.conf.json file, can some one help me here?
Below is my code,
{
"/users/userinfo": {
"target": "http://localhost:8000",
"secure": false
}
}