From fd6d4969a2d3e3995b57c03d90c15831e8318c7d Mon Sep 17 00:00:00 2001 From: wwysopal Date: Sat, 2 Mar 2024 12:36:40 +0100 Subject: [PATCH] Prepare app for AWS --- index.js | 13 +++++++------ package.json | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 35b9dbc..3bfebe0 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,6 @@ const server = http.createServer(function(request, response) { Node.js Number Adder - @@ -40,7 +39,7 @@ const server = http.createServer(function(request, response) {

Click the button below to add numbers from 1 to 100.

-
+
@@ -54,7 +53,9 @@ const server = http.createServer(function(request, response) { } }) -const port = 3000 -const host = '127.0.0.1' -server.listen(port, host) -console.log(`Listening at http://${host}:${port}`) +const PORT = process.env.PORT || 3000; +server.listen(PORT, () => { + console.log(`Server is running on port localhost:${PORT}`); +}); + + diff --git a/package.json b/package.json index 60484f0..661e27a 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "GitHubActions in development process", "main": "index.js", "scripts": { + "start": "node index.js", "test": "jest" - }, + }, "repository": { "type": "git", "url": "git+https://github.com/WiolaWysopal/GitHubActions.git"