The main application logic

There is no easy way around this, but our main application logic file, index.js, won't be as simple as the other configuration files have been:

'use strict'// Load our dependenciesconst bodyParser = require('body-parser')const express = require('express');const mongo = require('mongodb')// Setup database and server constantsconst DB_NAME = 'word_database';const DB_HOST = process.env.DB_HOST || 'localhost:27017';const COLLECTION_NAME = 'words';const SERVER_PORT = 8000;// Create our app, database clients, and the word list arrayconst app = express();const client = mongo.MongoClient();const dbUri = `mongodb://${DB_HOST}/${DB_NAME}`;const words = [];// Setup our templating engine and form data parserapp.set('view engine', ...

Get Deployment with Docker 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.