Skip to content

Conversation

@jamesmorgan
Copy link

These are the changes I need for each endpoint so I can access them from angular 2 admin app.

.then(function (docs) {
res.send(docs);
res.header("Access-Control-Allow-Origin", "http://localhost:3000").send(docs);
}, function (error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably add this across the board somehow

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ye very true, add a a piece of middleware like this to app.js before the other routes are defined:

app.get('/*',function(req,res,next){
    res.header("Access-Control-Allow-Origin", "http://localhost:3000");
    next(); 
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants