@roshub/express-xmlrpc
Express middleware and router support for xml-rpc
Last updated 2 years ago by nickzat .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @roshub/express-xmlrpc 
SYNC missed versions from official npm registry.

express-xmlrpc

xml-rpc server middleware for express built on node

'use strict'

const xmlrpc = require('express-xmlrpc')
const express = require('express')
const app = express()

const port = process.env.PORT || 9999

app.use(xmlrpc.bodyParser)

app.post('/', xmlrpc.apiHandler({
  echo: function (req, res) {
    xmlrpc.sendResult(req.body.params[0], req, res)
  }}
))

app.listen(port)

const client = xmlrpc.createClient({ port: port })
client.methodCall('echo', [{ data: 9001 }], (error, value) => {
  console.log(`error: '${error}'`)
  console.log(`value: '${JSON.stringify(value)}'`)
})

Installation

$ yarn add express-xmlrpc

Running Tests

make sure the dev dependencies are installed

$ yarn install

run the test

$ yarn test

Credits

Originally forked from the xrpc project. Uses Serializer and Deserializer logic from the rosnodejs package.

Current Tags

  • 0.4.2                                ...           latest (2 years ago)

1 Versions

  • 0.4.2                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |