Updates to setup process

This commit is contained in:
Wyatt Johnson
2017-06-07 11:08:39 -06:00
parent 6827ff2f1f
commit 4cbc8b2226
3 changed files with 183 additions and 161 deletions
+12 -1
View File
@@ -5,6 +5,7 @@ const app = require('../app');
const {createServer} = require('http');
const scraper = require('../services/scraper');
const mailer = require('../services/mailer');
const MigrationService = require('../services/migration');
const kue = require('../services/kue');
const mongoose = require('../services/mongoose');
const util = require('./util');
@@ -87,7 +88,17 @@ function onListening() {
/**
* Start the app.
*/
function startApp(program) {
async function startApp(program) {
try {
// Verify that the minimum migration version is met.
await MigrationService.verify();
} catch(e) {
console.error(e);
process.exit(1);
}
/**
* Listen on provided port, on all network interfaces.