From 529ebb2a8f73c9a4941a639b913d05b2eeed8de1 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Tue, 24 Nov 2020 20:08:30 +0100 Subject: [PATCH] clean up initial route sample ref #1 --- src/app.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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);