0.0.2 • Published 4 years ago

unirpc v0.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

UNIRPC

An unopinionated RPC barebones framework

Usage:

const unirpc = require('unirpc')
const service = unirpc({
  '*': async (req, res) => {
    console.log('this gets evaluated before anything on this tree')
  },

  method1: async (req, res) => {
    if (req.params.issue) {
      res.ok = true
    } else {
      res.ok = false
    }
  },

  subtree: unirpc(require('./another-file-with-req-res-pattern'))
})

service({method: 'subtree/submethod', params: { test: true } })

License

See LICENSE

0.0.2

4 years ago

0.0.1

4 years ago