diff options
| author | Tom Harley | 2018-02-13 10:23:19 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-02-13 10:23:19 +0000 |
| commit | 64e3aa18e638b58bda379bbd87db340ca206cd75 (patch) | |
| tree | 97ec85e68ffaa8794ca5c0afab58bbbf27bd389c /src/index.ts | |
| parent | introduced linter and enabled --strict in tsconfig (diff) | |
| download | medicine-64e3aa18e638b58bda379bbd87db340ca206cd75.tar.gz medicine-64e3aa18e638b58bda379bbd87db340ca206cd75.zip | |
edited source to comply with linter
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 25 |
1 files changed, 16 insertions, 9 deletions
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}`); +}); |
