aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
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}`);
+});