April 2020
Intermediate to advanced
292 pages
6h 50m
English
We need to pull this Aggregator into config.js and modify src/index.js so that it calls the Aggregator’s start function. config.js first, then start:
| | // ... |
| | const createHomePageAggregator = require('./aggregators/home-page') |
| | function createConfig ({ env }) { |
| | // ... |
| | const homePageAggregator = createHomePageAggregator({ |
| | db: knexClient, |
| | messageStore |
| | }) |
| | const aggregators = [ |
| | homePageAggregator, |
| | ] |
| | const components = [ |
| | ] |
| | return { |
| | // ... |
| | homePageAggregator, |
| | aggregators, |
| | components, |
| | } |
| | } |
We start by requireing the Aggregator. Then inside of createConfig we instantiate it by passing it the db and messageStore reference that were instantiated ...
Read now
Unlock full access