git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 0409dd215c605012fc66fc9bb693bf445866841b

add cors to api server

Michael Williams committed on 1/8/2016, 5:32:00 AM
Parent: 151a4f083fcf9352422148bd94eebc170209c940

Files changed

app/api.jschanged
package.jsonchanged
app/api.jsView
@@ -2,8 +2,9 @@
22 import feathers from 'feathers'
33 import hooks from 'feathers-hooks'
44 import rest from 'feathers-rest'
55 import bodyParser from 'body-parser'
6+import cors from 'cors'
67 import { map, mapObjIndexed, reduce, toPairs } from 'ramda'
78
89 import memory from 'feathers-memory'
910
@@ -21,8 +22,9 @@
2122 export default module.exports = createApi
2223
2324 function createApi (config) {
2425 const app = feathers()
26+ .use(cors())
2527 .configure(rest())
2628 .use(bodyParser.json())
2729 .use(bodyParser.urlencoded({ extended: true }))
2830 .configure(hooks())
package.jsonView
@@ -91,8 +91,9 @@
9191 "babelify": "^7.2.0",
9292 "browserify": "github:ahdinosaur/node-browserify",
9393 "bulk-require": "^0.2.1",
9494 "bulkify": "^1.1.1",
95+ "cors": "^2.7.1",
9596 "cpx": "^1.2.1",
9697 "css-modules-require-hook": "^2.1.0",
9798 "cssify": "github:ahdinosaur/cssify",
9899 "ecstatic": "^1.4.0",

Built with git-ssb-web