unirpc

0.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i unirpc

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

2.95 kB

Total Files

4

Last publish

Collaborators

  • chiguireitor