aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorTom Harley2018-02-13 19:15:20 +0000
committerTom Harley2018-02-13 19:15:20 +0000
commitb828d90527eeb86e7f0937117543736c57b43f04 (patch)
tree44c17c498c748c8c89a4f39b438eb710cc801238 /src/index.ts
parentMerge branch 'trh/docs' into 'master' (diff)
parentadded gitlab-ci job for linter (diff)
downloadmedicine-b828d90527eeb86e7f0937117543736c57b43f04.tar.gz
medicine-b828d90527eeb86e7f0937117543736c57b43f04.zip

Merge branch ‘trh/linter’

Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts25
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}`);
+});