Demo entry 1469913

Template 1

   

Submitted by anonymous on Mar 19, 2015 at 10:50
Language: JavaScript. Code size: 407 Bytes.

var seneca = require('seneca')()

            seneca.add( {role:'math', cmd:'sum'}, function(args,callback) {
            var sum = args.left + args.right
            callback(null,{answer:sum})
            })

            seneca.act( {role:'math', cmd:'sum', left:1, right:2}, function(err,result) {
            if( err ) return console.error( err )
            console.log(result)
            })

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).