Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Permit cross domain requests

  • Loading branch information...
commit da81b83200a99ecc0c801942a7e3f9c8b4bfd29d 1 parent a6542ba
@evdb evdb authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 index.js
View
6 index.js
@@ -6,6 +6,12 @@ module.exports = function () {
var app = express();
+ // Allow all domains to request data (see CORS for more details)
+ app.use(function (req, res, next) {
+ res.set("Access-Control-Allow-Origin", "*");
+ next();
+ });
+
// fake handler for the books endpoints
app.get("/books/:isbn", function (req, res) {
var isbn = req.param("isbn");
Please sign in to comment.
Something went wrong with that request. Please try again.