1.0.0 • Published 2 years ago

expressbridge-node v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

What's in this document

  • Overview
  • Quickstart Guide
  • Learning ExpressBridge
  • Sample Project
  • Release Notes
  • Documentation Site
  • How to Contribute

Overview: ExpressBridge Fundamentals

ExpressBridge provides a fluid, easy to use API that enables developers to stand up new microservices that handle, process, and dispatch messages with ease. The API surface is small and straightforward. Consider the following example:

const handler = (message) => {
    const expressBridge = new ExpressBridge({
        alwaysRunHooks: true,
    });

    expressBridge.pre((message) => {
        // ... pre-process message
    });

    expressBridge.post((message) => {
        // ... post-process message
    });

    // respond to some generic AWS events
    const awsEventHandler = (message) => { /* ... write to db, log event, dispatch message, etc */ }
    expressBridge.use({ source: 'aws.*' }, awsEventHandler, (err) => { console.log(err) }) 

    expressBridge.process(message);
}

The above example represents the entire API surface of the framework in its simplest implementation. However, ExpressBridge is highly configurable so as to be suitable for a wide range of scenarios. Understanding this configurability will enable you to fully leverage the power of this framework.