forked from nodezoo/nodezoo-web
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathseneca-init.js
More file actions
51 lines (37 loc) · 999 Bytes
/
Copy pathseneca-init.js
File metadata and controls
51 lines (37 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use strict";
var seneca = require('seneca')
var api = seneca()
if( 'dev' != api.options().env ) {
api
.use('./lib/api.js')
.client({port:9100,pin:'role:info'})
.listen(9000)
}
else {
api
.use('jsonfile-store',{folder:__dirname+'/data'})
.use('../nodezoo-github')
.use('../nodezoo-npm')
.use('../nodezoo-info')
.use('./lib/api.js')
.add('role:info,req:part',function(args,done){
done()
this.act(
'role:npm,cmd:get',
{name:args.name},
function(err,mod){
this.act('role:info,res:part,part:npm',
{name:args.name,data:mod})
this.act(
'role:github,cmd:get',
{name:args.name,giturl:mod.giturl},
function(err,mod){
this.act('role:info,res:part,part:github',
{name:args.name,data:mod})
})
})
})
}
module.exports = function(){
return api.export('web')
}