diff --git a/src/app.ts b/src/app.ts index ccdde8b..f036136 100644 --- a/src/app.ts +++ b/src/app.ts @@ -9,18 +9,11 @@ const app = express(); const PORT = process.env.APP_PORT || 4010; createConnection() - .then((connection) => { - app.get('/', (req, res) => { - const encoded = jwt.sign({ key: 'value' }, 'secret'); - consola.info(encoded); - return res.send('Express + TypeScript Server'); - }); - app.listen(PORT, () => { - consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`); - }); - }) + .then((connection) => {}) .catch((err) => { consola.error(err); + }) + .finally(() => { app.get('/', (req, res) => { const encoded = jwt.sign({ key: 'value' }, 'secret'); consola.info(encoded);