-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import app from './index'; | ||
import makeApp from './index'; | ||
import { logger } from './util/logger'; | ||
|
||
// Start Express server. | ||
const server = app.listen(app.get('port'), () => { | ||
logger.info(`Curator service listening on port ${app.get('port')}`); | ||
logger.info(' Press CTRL-C to stop\n'); | ||
}); | ||
let server; | ||
|
||
// Set global 1-hour timeout. | ||
// TODO: Make this more fine-grained once we fix | ||
// https://github.com/globaldothealth/list/issues/961. | ||
server.setTimeout(60 * 60 * 1000); | ||
makeApp().then(app => { | ||
server = app.listen(app.get('port'), () => { | ||
logger.info(`Curator service listening on port ${app.get('port')}`); | ||
logger.info(' Press CTRL-C to stop\n'); | ||
}); | ||
// Set global 1-hour timeout. | ||
// TODO: Make this more fine-grained once we fix | ||
// https://github.com/globaldothealth/list/issues/961. | ||
server.setTimeout(60 * 60 * 1000); | ||
}) | ||
.catch(e => { | ||
logger.error('Could not start server!', e); | ||
process.exit(1); | ||
}); | ||
|
||
export default server; |