Is it possible to tell the difference between a request coming directly from a URL in a browser vs. a resource being called from a remote web page?
For example, I would
In middleware you have to use this way "req.headers.origin"
app.use(function(req, res, next) { //var origin=req.headers.origin next(); });