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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.