April 2020
Intermediate to advanced
292 pages
6h 50m
English
We start with our standard config.js work, and then we’ll deal with Express:
| | // ... |
| | const createAdminApp = require('./app/admin') |
| | function createConfig ({ env }) { |
| | // ... |
| | const adminApp = createAdminApp({ |
| | db: knexClient, |
| | messageStoreDb: postgresClient |
| | }) |
| | return { |
| | // ... |
| | adminApp, |
| | } |
| | } |
Require. Instantiate. Return. Sounds like the makings of a political candidate’s slogan. Notice the Admin Portal takes a reference to the Message Store’s database connection. We’ll do some queries against the Message Store directly.
Let’s mount it in Express:
| | function mountRoutes (app, ... |
Read now
Unlock full access