From 10cb7517549bb1d26ad46a91dc5cdcac8a3a80ce Mon Sep 17 00:00:00 2001
From: harshrajurkar <88499120+harshrajurkar@users.noreply.github.com>
Date: Thu, 20 Nov 2025 09:52:57 +0000
Subject: [PATCH 1/7] forked
---
package-lock.json | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 61b5dcb84..3b7b577d5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,5 +1,13 @@
{
- "name": "papa-node-hello-000",
+ "name": "node-hello",
"version": "1.0.0",
- "lockfileVersion": 1
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "node-hello",
+ "version": "1.0.0",
+ "license": "ISC"
+ }
+ }
}
From 7d6854ad7e56d6a75d8c1a08c6e941b411e7d483 Mon Sep 17 00:00:00 2001
From: harshrajurkar <88499120+harshrajurkar@users.noreply.github.com>
Date: Thu, 20 Nov 2025 10:11:03 +0000
Subject: [PATCH 2/7] new code added
---
index.html | 35 +++++++++++++++++++++++++++++++++++
index.js | 19 +++++++++++++++----
2 files changed, 50 insertions(+), 4 deletions(-)
create mode 100644 index.html
diff --git a/index.html b/index.html
new file mode 100644
index 000000000..451fb3e91
--- /dev/null
+++ b/index.html
@@ -0,0 +1,35 @@
+
+
+
+ My Simple Node Page
+
+
+
+
+
Hello from Node.js!
+
This webpage is served from a separate index.html file.
+
+
+
diff --git a/index.js b/index.js
index 54e5fef1f..cf047ec52 100644
--- a/index.js
+++ b/index.js
@@ -1,12 +1,23 @@
const http = require('http');
+const fs = require('fs');
+const path = require('path');
+
const port = process.env.PORT || 3000;
const server = http.createServer((req, res) => {
- res.statusCode = 200;
- const msg = 'Hello Node!\n'
- res.end(msg);
+ const filePath = path.join(__dirname, 'index.html');
+
+ fs.readFile(filePath, (err, content) => {
+ if (err) {
+ res.writeHead(500);
+ res.end('Error loading file');
+ } else {
+ res.writeHead(200, { 'Content-Type': 'text/html' });
+ res.end(content);
+ }
+ });
});
server.listen(port, () => {
- console.log(`Server running on http://localhost:${port}/`);
+ console.log(`Server running at http://localhost:${port}`);
});
From 91078d4233ce92519be81016b92b4d209ac7ac67 Mon Sep 17 00:00:00 2001
From: harshrajurkar <88499120+harshrajurkar@users.noreply.github.com>
Date: Fri, 21 Nov 2025 09:32:13 +0000
Subject: [PATCH 3/7] added jenkins file
---
Jenkinsfile | 35 +++++++++++++++++++++++++++++++++++
index.html | 2 +-
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 Jenkinsfile
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 000000000..052aa5775
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,35 @@
+pipeline {
+ agent any
+
+ tools {
+ nodejs 'nodejs'
+ }
+
+ stages {
+
+ stage('Checkout Code') {
+ steps {
+ git branch: 'master', url: 'https://github.com/harshrajurkar/node-hello.git'
+ }
+ }
+
+ stage('Upload index.html to S3') {
+ steps {
+ withAWS(region: 'ap-south-1', credentials: 'aws-creds') {
+ s3Upload bucket: 'my-frontend-site-node',
+ file: 'index.html',
+ path: "index.html"
+ }
+ }
+ }
+ }
+
+ post {
+ success {
+ echo "index.html uploaded to S3 successfully!"
+ }
+ failure {
+ echo "Upload failed!"
+ }
+ }
+}
diff --git a/index.html b/index.html
index 451fb3e91..fbcbac0c0 100644
--- a/index.html
+++ b/index.html
@@ -28,7 +28,7 @@
-
Hello from Node.js!
+
sucessfull deployemnt!
This webpage is served from a separate index.html file.
From 439c9f659855d6057325280dc94367a48b80d370 Mon Sep 17 00:00:00 2001
From: harshrajurkar <88499120+harshrajurkar@users.noreply.github.com>
Date: Fri, 21 Nov 2025 10:06:52 +0000
Subject: [PATCH 4/7] chnaged into index.html
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index fbcbac0c0..665d3b65d 100644
--- a/index.html
+++ b/index.html
@@ -29,7 +29,7 @@
sucessfull deployemnt!
-
This webpage is served from a separate index.html file.
+
This webpage is served from a separate index.html file for s3.