Connecting the Home Page Application

Let’s head over to config.js and pull the home page application into the system:

1: const​ createKnexClient = require(​'./knex-client'​)
const​ createHomeApp = require(​'./app/home'​)
function​ createConfig ({ env }) {
const​ db = createKnexClient({
5:  connectionString: env.databaseUrl
})
const​ homeApp = createHomeApp({ db })
return​ {
// ...
10:  db,
homeApp,
}
}

Lines 1 and 2 pull in the functions to create our database interaction code and the home application you just wrote, respectively. Using the databaseUrl from env, we instantiate our database interaction code at line 4. Since you haven’t written that yet, you can imagine it to be simply ...

Get Practical Microservices now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.