Seneca is a Node-based microservice construction kit that helps you organize your code into distinct actions triggered by patterns. Seneca applications are composed of services that can accept JSON messages and optionally return some JSON. Services register an interest in messages with certain characteristics. For example, a service might run whenever a JSON message displaying the { cmd: "doSomething" } pattern is broadcast.
To start, let’s create a service that responds to three patterns, one pattern returning “Hello!”, and the other two different ways of saying “Goodbye!”.
Create a hellogoodbye.js file containing the following code:
// hellogoodbye.jsconst seneca = require('seneca')({ log: 'silent' });const