Skip to content Skip to sidebar Skip to footer

Cors Issue When Rest Api Application Server(express) And Angulars Js Application Running On Different Port

I have rest api application written in node.js & express is running on port 3000 and angularjs application running on port 9001 on same server . On calling rst api from angula

Solution 1:

I solved it by adding adding line app.options('*', cors()); just before all routes.

It was an issue of preflight request with http-request-header "OPTIONS"

Solution 2:

You can set the solution to be

app.configure('development', function(){
    app.set('origins', '*:*');
}

Post a Comment for "Cors Issue When Rest Api Application Server(express) And Angulars Js Application Running On Different Port"