A HTTP utility plugin for the Seneca toolkit
DOCUMENTATION IN PROGRESS
There are many examples of usage however - see seneca-examples and well app.
If you're using this module, feel free to contact me on Twitter if you have any questions! :) @rjrodger
Current Version: 0.2.2
Tested on: Node 0.10.29, Seneca 0.5.19
var seneca = require('seneca')()
seneca.add('role:foo,cmd:bar',function(args,done){
done(null,{bar:args.zoo+'b'})
})
seneca.act('role:web',{use:{
prefix:'/foo',
pin:{role:'foo',cmd:'*'},
map:{
bar: {GET:true}
}
}})
var connect = require('connect')
var app = connect()
app.use( connect.query() )
app.use( seneca.export('web') )
app.listen(3000)
// run: node test/example.js --seneca.log=type:act
// try http://localhost:3000/foo/bar?zoo=a
// returns {"bar":"ab"}
npm test