rpc-node

Client rpc for nodejs

###rpc-node
Simple rpc for node/express

Like this..

###app.js

    var express = require('express'), app = express();
    var server = require('http').createServer(app)
    server.listen(85);
 
    require('./rpc-node.js')(app, {
        '/rpc/gettime'function(params){
            return {e: null, r:new Date()}
        }
    })
 
    app.get('/', function(r,s){
        s.sendfile('index.html')
    })

###index.html

<script src='/rpc'></script>
<div id='timeis'/>
 
<script>
    rpc('/rpc/gettime', function(e,r){
        console.log(r)
        document.getElementById('timeis').innerHTML = r;
    }, null)
</script>