Skip to content

Instantly share code, notes, and snippets.



Last active Feb 6, 2018
What would you like to do?
Handling CORS in Meteor app
* packages/reststop2/auth.js
* Add a method to handle OPTIONS request
// return nothing
RESTstop.add('login', {'method': 'OPTIONS'}, function() {})
* packages/reststop2/server.js
* line 142
WebApp.connectHandlers.use(function(req, res, next) {
// add allow origin
res.setHeader('Access-Control-Allow-Origin', '*');
// add headers
res.setHeader('Access-Control-Allow-Headers', [
].join(', '));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.