From 0f70729c6218d83bd819ca397303bc3ad6f80ebb Mon Sep 17 00:00:00 2001 From: ajayr Date: Mon, 1 Apr 2024 11:19:16 +0530 Subject: [PATCH 1/8] ajay --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5f35242ee8..c6768403e4 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ var http = require('http'); http.createServer(function (req, res) { console.log(`Just got a request at ${req.url}!`) - res.write('Yo!'); + res.write('ajay'); res.end(); }).listen(process.env.PORT || 3000); \ No newline at end of file From 01d111c1b8bae70459e3b66f2aec5867a34ba451 Mon Sep 17 00:00:00 2001 From: ajayr Date: Mon, 1 Apr 2024 11:21:15 +0530 Subject: [PATCH 2/8] ajay rawat --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c6768403e4..723bacdbe9 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ var http = require('http'); http.createServer(function (req, res) { console.log(`Just got a request at ${req.url}!`) - res.write('ajay'); + res.write('ajay rawat'); res.end(); }).listen(process.env.PORT || 3000); \ No newline at end of file From f33703a0f20f1675f9567ab223be8b8f872008bd Mon Sep 17 00:00:00 2001 From: ajayr Date: Mon, 1 Apr 2024 11:27:16 +0530 Subject: [PATCH 3/8] Main ajay --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 723bacdbe9..8727d63d53 100644 --- a/index.js +++ b/index.js @@ -3,4 +3,4 @@ http.createServer(function (req, res) { console.log(`Just got a request at ${req.url}!`) res.write('ajay rawat'); res.end(); -}).listen(process.env.PORT || 3000); \ No newline at end of file +}).listen(process.env.PORT || 3000); From d2ec1ed8b7552fa6aa59a07ce154336b26c0ecc5 Mon Sep 17 00:00:00 2001 From: ajayr Date: Thu, 4 Apr 2024 22:16:24 +0530 Subject: [PATCH 4/8] aj --- index.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 8727d63d53..4e8abf4be0 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,23 @@ -var http = require('http'); -http.createServer(function (req, res) { - console.log(`Just got a request at ${req.url}!`) - res.write('ajay rawat'); - res.end(); -}).listen(process.env.PORT || 3000); +// var http = require('http'); +// http.createServer(function (req, res) { +// console.log(`Just got a request at ${req.url}!`) +// res.write('ajay rawat'); +// res.end(); +// }).listen(process.env.PORT || 3000); + + + +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +rl.question('Enter the first number: ', (num1) => { + rl.question('Enter the second number: ', (num2) => { + const result = parseFloat(num1) + parseFloat(num2); + console.log(`The sum of ${num1} and ${num2} is: ${result}`); + rl.close(); + }); +}); From ba5bc7190230659b5f6acfaf2a26314ec8dd7442 Mon Sep 17 00:00:00 2001 From: ajayr Date: Thu, 4 Apr 2024 22:19:20 +0530 Subject: [PATCH 5/8] a --- index.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 4e8abf4be0..71e6b22e86 100644 --- a/index.js +++ b/index.js @@ -1,23 +1,23 @@ -// var http = require('http'); -// http.createServer(function (req, res) { -// console.log(`Just got a request at ${req.url}!`) -// res.write('ajay rawat'); -// res.end(); -// }).listen(process.env.PORT || 3000); +var http = require('http'); +http.createServer(function (req, res) { + console.log(`Just got a request at ${req.url}!`) + res.write('ajay rawat'); + res.end(); +}).listen(process.env.PORT || 3000); -const readline = require('readline'); +// const readline = require('readline'); -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); +// const rl = readline.createInterface({ +// input: process.stdin, +// output: process.stdout +// }); -rl.question('Enter the first number: ', (num1) => { - rl.question('Enter the second number: ', (num2) => { - const result = parseFloat(num1) + parseFloat(num2); - console.log(`The sum of ${num1} and ${num2} is: ${result}`); - rl.close(); - }); -}); +// rl.question('Enter the first number: ', (num1) => { +// rl.question('Enter the second number: ', (num2) => { +// const result = parseFloat(num1) + parseFloat(num2); +// console.log(`The sum of ${num1} and ${num2} is: ${result}`); +// rl.close(); +// }); +// }); From 0f1fcda3fa96eeb1ec3d049a4449b4483aff4994 Mon Sep 17 00:00:00 2001 From: ajayr Date: Thu, 4 Apr 2024 22:21:24 +0530 Subject: [PATCH 6/8] as --- index.js | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/index.js b/index.js index 71e6b22e86..42edb4b2fe 100644 --- a/index.js +++ b/index.js @@ -1,23 +1,39 @@ -var http = require('http'); -http.createServer(function (req, res) { +// var http = require('http'); +// http.createServer(function (req, res) { +// console.log(`Just got a request at ${req.url}!`) +// res.write('ajay rawat'); +// res.end(); +// }).listen(process.env.PORT || 3000); + + + + +const http = require('http'); +const readline = require('readline'); + +const server = http.createServer(function (req, res) { console.log(`Just got a request at ${req.url}!`) res.write('ajay rawat'); res.end(); }).listen(process.env.PORT || 3000); +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); +server.on('listening', () => { + console.log('Server is running.'); + rl.question('Enter the first number: ', (num1) => { + rl.question('Enter the second number: ', (num2) => { + const result = parseFloat(num1) + parseFloat(num2); + console.log(`The sum of ${num1} and ${num2} is: ${result}`); + rl.close(); + server.close(); + }); + }); +}); -// const readline = require('readline'); - -// const rl = readline.createInterface({ -// input: process.stdin, -// output: process.stdout -// }); - -// rl.question('Enter the first number: ', (num1) => { -// rl.question('Enter the second number: ', (num2) => { -// const result = parseFloat(num1) + parseFloat(num2); -// console.log(`The sum of ${num1} and ${num2} is: ${result}`); -// rl.close(); -// }); -// }); +server.on('close', () => { + console.log('Server closed.'); +}); From 98a8d1f0cbaea25f1ad2cf0099aac6e05952518b Mon Sep 17 00:00:00 2001 From: ajayr Date: Thu, 4 Apr 2024 22:25:04 +0530 Subject: [PATCH 7/8] v --- index.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 42edb4b2fe..b84300c226 100644 --- a/index.js +++ b/index.js @@ -8,19 +8,19 @@ -const http = require('http'); -const readline = require('readline'); - -const server = http.createServer(function (req, res) { - console.log(`Just got a request at ${req.url}!`) - res.write('ajay rawat'); - res.end(); -}).listen(process.env.PORT || 3000); - -const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); +// const http = require('http'); +// const readline = require('readline'); + +// const server = http.createServer(function (req, res) { +// console.log(`Just got a request at ${req.url}!`) +// res.write('ajay rawat'); +// res.end(); +// }).listen(process.env.PORT || 3000); + +// const rl = readline.createInterface({ +// input: process.stdin, +// output: process.stdout +// }); server.on('listening', () => { console.log('Server is running.'); From 942120e4ac6140428765a7739ba3e9f22aa806c8 Mon Sep 17 00:00:00 2001 From: ajayr Date: Thu, 4 Apr 2024 22:27:04 +0530 Subject: [PATCH 8/8] s --- index.js | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/index.js b/index.js index b84300c226..8727d63d53 100644 --- a/index.js +++ b/index.js @@ -1,39 +1,6 @@ -// var http = require('http'); -// http.createServer(function (req, res) { -// console.log(`Just got a request at ${req.url}!`) -// res.write('ajay rawat'); -// res.end(); -// }).listen(process.env.PORT || 3000); - - - - -// const http = require('http'); -// const readline = require('readline'); - -// const server = http.createServer(function (req, res) { -// console.log(`Just got a request at ${req.url}!`) -// res.write('ajay rawat'); -// res.end(); -// }).listen(process.env.PORT || 3000); - -// const rl = readline.createInterface({ -// input: process.stdin, -// output: process.stdout -// }); - -server.on('listening', () => { - console.log('Server is running.'); - rl.question('Enter the first number: ', (num1) => { - rl.question('Enter the second number: ', (num2) => { - const result = parseFloat(num1) + parseFloat(num2); - console.log(`The sum of ${num1} and ${num2} is: ${result}`); - rl.close(); - server.close(); - }); - }); -}); - -server.on('close', () => { - console.log('Server closed.'); -}); +var http = require('http'); +http.createServer(function (req, res) { + console.log(`Just got a request at ${req.url}!`) + res.write('ajay rawat'); + res.end(); +}).listen(process.env.PORT || 3000);