diff options
| author | jw255 | 2018-04-19 14:21:38 +0100 |
|---|---|---|
| committer | jw255 | 2018-04-19 14:21:38 +0100 |
| commit | 8af06a4e7ea7ebaa29559a345d28791079b77dd3 (patch) | |
| tree | 934011c09ca28aa839a7f1f461de5ac89a20ab48 /src/index.ts | |
| parent | minor fixes (diff) | |
| download | medicine-8af06a4e7ea7ebaa29559a345d28791079b77dd3.tar.gz medicine-8af06a4e7ea7ebaa29559a345d28791079b77dd3.zip | |
no reset
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) { |
