git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 0a19ff71e90207bdc5e6b22d5470c11617f9f7b0

Files: 0a19ff71e90207bdc5e6b22d5470c11617f9f7b0 / app / server.js

593 bytesRaw
1const feathers = require('feathers')
2const { mapObjIndexed, reduce, toPairs } = require('ramda')
3
4const serviceCreators = require('./services')
5
6module.exports = createServer
7
8const useAll = function (app, services) {
9 return reduce((app, [name, service]) => {
10 return app.use(`/${name}`, service)
11 }, app, toPairs(services))
12}
13
14function createServer (config) {
15
16 const services = mapObjIndexed(
17 (serviceCreator, name) => {
18 return serviceCreator(config.services[name])
19 },
20 serviceCreators
21 )
22
23 const server = feathers()
24
25 useAll(server, services)
26
27 return server
28}
29
30

Built with git-ssb-web