Files: 8d668726e7d11fcdfc803f3c47ed305680c7194f / app / api.js
457 bytesRaw
1 | const feathers = require('feathers') |
2 | const { mapObjIndexed, reduce, toPairs } = require('ramda') |
3 | |
4 | const services = require('app/services') |
5 | const config = require('app/config') |
6 | |
7 | module.exports = createServer |
8 | |
9 | function createServer (config) { |
10 | const app = feathers() |
11 | |
12 | useAll(app, services) |
13 | |
14 | return app |
15 | } |
16 | |
17 | function useAll (app, services) { |
18 | return reduce((app, [name, service]) => { |
19 | return app.use(`/${name}`, service) |
20 | }, app, toPairs(services)) |
21 | } |
22 |
Built with git-ssb-web