April 2020
Intermediate to advanced
292 pages
6h 50m
English
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 ...
Read now
Unlock full access