Skip to content
Browse files

Added CORS middleware to api server

  • Loading branch information...
1 parent c2ac47d commit 9bc965ef72b1da39cbceb7a29ba71b3b14976e41 @ggoodman ggoodman committed Apr 27, 2012
Showing with 5 additions and 1 deletion.
  1. +3 −1 package.json
  2. +2 −0 servers/api/index.coffee
View
4 package.json
@@ -30,6 +30,8 @@
"authom": "0.3.x",
"nconf": "0.5.x",
"revalidator": "0.1.x",
- "request": "2.9.x"
+ "request": "2.9.x",
+ "connect": "1.x",
+ "connect-cors": "0.5.x"
}
}
View
2 servers/api/index.coffee
@@ -1,6 +1,7 @@
nconf = require("nconf")
request = require("request")
express = require("express")
+cors = require("connect-cors")
_ = require("underscore")._
module.exports = app = express.createServer()
@@ -18,6 +19,7 @@ auths = new Database("/tmp/auths.json")
app.configure ->
+ app.use cors()
app.use express.cookieParser()
app.use require("./middleware/json").middleware()
app.use require("./middleware/auth").middleware(auths: auths)

0 comments on commit 9bc965e

Please sign in to comment.
Something went wrong with that request. Please try again.