0.1.0 • Published 6 years ago

rx-micro v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

rx-micro — Reactive HTTP microservices

Built on-top of micro with RxJS6 instead of async/await.

Install

npm i rx-micro

Usage

Create an index.js file and export a function which accepts the standard http.IncomingMessage and http.ServerResponse parameters as well as an Rx Observable:

module.exports = (req, res, request$) => {
  return request$.pipe(mapTo('Hello world!'))
}

Like micro, rx-micro handles return values:

module.exports = () => 'Hello world!'

Command Line

npx rx-micro