From 64e3aa18e638b58bda379bbd87db340ca206cd75 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Tue, 13 Feb 2018 10:23:19 +0000 Subject: edited source to comply with linter --- src/index.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 69150e2..54ff848 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,21 @@ +/* tslint:disable:no-console + * This only goes here until we have a logging system */ + +import app from './app'; + console.log('Welcome to the CS3099 Server thingy!'); -import app from './app' +const DEFAULT_PORT: number = 3000; -// use default port 3000 or port supplied by OS -const port = process.env.PORT || 3000 +// Use default port 3000 or port supplied by OS +const port: number = process.env.PORT + ? process.env.PORT + : DEFAULT_PORT; -app.listen(port, (err) => { - if (err) { - return console.log(err) - } +app.listen(port, (err: Error): void => { + if (err) { + return console.log(err); + } - return console.log(`server is listening on port ${port}`) -}) \ No newline at end of file + return console.log(`server is listening on port ${port}`); +}); -- cgit v1.2.1