Files: 4d1aa8528ed9342d5d663af75cb08beb82f0fbcc / router / sync / router.js
453 bytesRaw
1 | const nest = require('depnest') |
2 | const sheetRouter = require('sheet-router') |
3 | |
4 | exports.gives = nest('router.sync.router') |
5 | |
6 | exports.needs = nest('router.sync.routes', 'reduce') |
7 | |
8 | exports.create = (api) => { |
9 | var _router = null |
10 | return nest('router.sync.router', router) |
11 | |
12 | function router (path) { |
13 | if (_router) return _router(path) |
14 | |
15 | _router = sheetRouter( |
16 | {default: '/'}, |
17 | api.router.sync.routes() |
18 | ) |
19 | return _router(path) |
20 | } |
21 | } |
22 | |
23 |
Built with git-ssb-web