Our service is going to record events of interest in the system such as page loads. In a full system we might record this type of information against specific user ID's in order to analyze system usage patterns. However, since our basic system doesn't include user context we will simply be recording events as system events.
Let's start by creating a directory for our service and initializing it with a package.json, then install the redis, mongodb, and concordant modules, as follows:
$ cd micro$ mkdir eventservice$ cd eventservice$ npm init -y$ npm install --save redis mongodb concordant
Next we'll create the now familiar service structure within our micro/eventservice folder:
$ touch index.js wiring.js service.js
Our usual ...