Now it's time for a completely different approach. Let's look at another framework called Seneca. This framework was designed to help you develop message-based microservices. It has two distinct characteristics:
- Transport agnostic: Communication and message transport is separated from your service logic and it's easy to swap transports
- Pattern matching: Messages are JSON objects and each function exposes what sort of messages they can handle based on object properties
Being able to change transports is not a big deal; many tools allow you to do so. What is really interesting about this framework is its ability to expose functions based on object patterns. Let's start by installing Seneca:
npm install seneca
For now, let's forget ...