diff options
| author | Tom Harley | 2018-04-19 14:59:28 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-04-19 14:59:28 +0100 |
| commit | 830ac925c9248d77d55d221887b7a41fd205312d (patch) | |
| tree | 7e21befd060b2f215d0629ef26bf967db29c09b0 /src/index.ts | |
| parent | Fix tests for matcher, and minor import edits (diff) | |
| parent | no reset (diff) | |
| download | medicine-830ac925c9248d77d55d221887b7a41fd205312d.tar.gz medicine-830ac925c9248d77d55d221887b7a41fd205312d.zip | |
Merge branch ‘trh/gets’ of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/project-code into trh/gets
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/index.ts b/src/index.ts index 5960374..1ce284d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,16 +22,7 @@ const port: number = process.env.PORT : DEFAULT_PORT; logger.info(`Port ${port} chosen`); -// tslint:disable:no-floating-promises -(async(): Promise<void> => { - try { - logger.info('Authenticating with database'); - await seq.authenticate(); - } catch (err) { - logger.error(`Cannot authenticate with database: ${err}`); - process.exit(1); - } - +async function reset(): Promise<void> { try { logger.info('Resetting Database'); await seq.sync({ @@ -91,6 +82,20 @@ logger.info(`Port ${port} chosen`); } }); +} + +// tslint:disable:no-floating-promises +(async(): Promise<void> => { + try { + logger.info('Authenticating with database'); + await seq.authenticate(); + } catch (err) { + logger.error(`Cannot authenticate with database: ${err}`); + process.exit(1); + } + + //await reset(); + logger.info('Booting ExpressJS server'); app.listen(port, (err: Error) => { if (err) { |
