Commit 0409dd215c605012fc66fc9bb693bf445866841b
add cors to api server
Michael Williams committed on 1/8/2016, 5:32:00 AMParent: 151a4f083fcf9352422148bd94eebc170209c940
Files changed
app/api.js | changed |
package.json | changed |
app/api.js | ||
---|---|---|
@@ -2,8 +2,9 @@ | ||
2 | 2 | import feathers from 'feathers' |
3 | 3 | import hooks from 'feathers-hooks' |
4 | 4 | import rest from 'feathers-rest' |
5 | 5 | import bodyParser from 'body-parser' |
6 | +import cors from 'cors' | |
6 | 7 | import { map, mapObjIndexed, reduce, toPairs } from 'ramda' |
7 | 8 | |
8 | 9 | import memory from 'feathers-memory' |
9 | 10 | |
@@ -21,8 +22,9 @@ | ||
21 | 22 | export default module.exports = createApi |
22 | 23 | |
23 | 24 | function createApi (config) { |
24 | 25 | const app = feathers() |
26 | + .use(cors()) | |
25 | 27 | .configure(rest()) |
26 | 28 | .use(bodyParser.json()) |
27 | 29 | .use(bodyParser.urlencoded({ extended: true })) |
28 | 30 | .configure(hooks()) |
package.json | ||
---|---|---|
@@ -91,8 +91,9 @@ | ||
91 | 91 | "babelify": "^7.2.0", |
92 | 92 | "browserify": "github:ahdinosaur/node-browserify", |
93 | 93 | "bulk-require": "^0.2.1", |
94 | 94 | "bulkify": "^1.1.1", |
95 | + "cors": "^2.7.1", | |
95 | 96 | "cpx": "^1.2.1", |
96 | 97 | "css-modules-require-hook": "^2.1.0", |
97 | 98 | "cssify": "github:ahdinosaur/cssify", |
98 | 99 | "ecstatic": "^1.4.0", |
Built with git-ssb-web