* Install throng for easy cluster management
* Extract the Express app construction into its own file
* Switch server.js to use app clustering for deployed environments
* Worker count is based on the lesser of process.env.WEB_CONCURRENCY and the count of CPUs
* Reading clustered output is difficult, let's prefix the std{out,err} streams
Co-authored-by: Jason Etcovitch <jasonetco@github.com>
10 lines
373 B
JavaScript
10 lines
373 B
JavaScript
const semver = require('semver')
|
|
const { engines } = require('../package.json')
|
|
|
|
/* istanbul ignore next */
|
|
if (!semver.satisfies(process.version, engines.node)) {
|
|
console.error(`\n\nYou're using Node.js ${process.version}, but ${engines.node} is required`)
|
|
console.error('Visit nodejs.org to download an installer for the latest LTS version.\n\n')
|
|
process.exit(1)
|
|
}
|