jquery - Implementing CORS in Angular+ Node -


i have impolemented frontend in node+angular js , backend running in jetty exposing rest service.i want send rest rquest fe(angular) backend.when passing complete url $http.get works fine.however want mak configurable value change in url/port not require me change elsewhere apart configuration.currently passing $http.post("http://localhost:8080/test/login/dostuff",dataobj) want pass $http.post("/test/login/dostuff",dataobj) , automatically should append http://localhost:8080.can me on this?

thanks

cors used enable communication trust between 2 different hosts. example if front end , back-end hosted in 2 different servers (not in same domain) requires cors communicate in between.
however, in case, not see valid case except deployed apart explained.
web app can communicate using relative paths long hosted in same server.
if app hosted inside /myapp folder, can access other resources using /myapp/other-web-folders.
if want communicate outside domain, have full url. hope clarifies doubts.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -