In my node express app I wish to allow unrestricted access to my /api/publicdata endpoint What is the proper syntax for the allow-origin?
Asked
Active
Viewed 28 times
0
-
With [express static](http://expressjs.com/starter/static-files.html)? `app.get('/api/data/publicdata/*, express.static('/dir/to/api/data/publicdata'))` – laggingreflex May 30 '15 at 16:13
-
It will not be static. It will be a dynamo array of json objects obtained from mongo. In this form: res.json(data) – Eugene Goldberg May 30 '15 at 16:50
-
So just `app.get('/api/data/publicdata', function(req,res,n){ res.json(data) }`? – laggingreflex May 30 '15 at 18:27
-
yes, that is exactly what it is. – Eugene Goldberg May 30 '15 at 18:42