0.1.0 • Published 7 years ago
rx-micro v0.1.0
rx-micro — Reactive HTTP microservices
Built on-top of micro with RxJS6 instead of async/await.
Install
npm i rx-microUsage
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-micro0.1.0
7 years ago