import { ApiServer } from './server'; export const start = (): Promise => { return new Promise((resolve, reject) => { const apiServer = new ApiServer(); apiServer .start() .then(resolve) .catch(reject); const graceful = () => { apiServer.stop().then(() => process.exit(0)); }; process.on('SIGTERM', graceful); process.on('SIGINT', graceful); }); };