Building HTTP Server in NodeJS

  Рет қаралды 126,681

Piyush Garg

Piyush Garg

Күн бұрын

Hey Everyone, In this video, we will create our own HTTP web server using NodeJS and HTTP built-in module in NodeJS
► Complete Full Stack Web Developer RoadMap 2023: • Complete Full Stack We...
► Master NodeJS Playlist: • Master NodeJS
Quick Links
Node.JS Website: nodejs.org/en/
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript on the server side, creating server-side applications with JavaScript.
► My Website: www.piyushgarg...
My Gears
► My Girlfriend: amzn.to/3WD6FRp
► Apple MacBook Laptop: amzn.to/3WBJgQn
► Anker USB Hub: amzn.to/3GhZSr0
► Blue Yeti Microphone: amzn.to/3YKZ9FT
► External 27” Monitor: amzn.to/3Vp3xaO
► Logitech MK295 Wireless Keyboard and Mouse: amzn.to/3DuL1bB
► Seagate Expansion 1TB External HDD: amzn.to/3QMm5Q8
► Tripod: amzn.to/3S4OwK4
► Ring Light: amzn.to/3YLf8DR
Disclaimer: All the links above are affiliate links.
Social Links
► Twitter - / piyushgarg_dev
► LinkedIn - / piyushgarg195
Video Titles
What is NodeJS?
HTTP Server NodeJS
Creating Web Server in NodeJS
HTTP Module in NodeJS
NodeJS Tutorial in Hindi
Tags
#nodejs #javascript #developer #server #javascriptinhindi #webdevelopment #webapp #realtimeapp #serverside #nonblockingio #tech

Пікірлер: 103
@HyperSonicSam
@HyperSonicSam 5 ай бұрын
Wow. This has helped me so much. It is my first day starting Node.JS, and looking at the code level, I could never imagine learning this anywhere else. This feels easy now. Thank you Piyush!
@AindrilaDutta-cr2tg
@AindrilaDutta-cr2tg 25 күн бұрын
After one week of going through numerous videos i finally landed on something thats beginner friendly. Nobody teaches from scratch the way you did. Thank you! I will definitely provide another review after completing the entire playlist.
@tarungrover9841
@tarungrover9841 10 күн бұрын
Yaar how come you giving so much quality videos for free. I am a backend developer but still learnt a lot from your videos. Kamaal ho aap. Please make a full backend tutorial covering scaling and design principles and deployment on servers as well. Thanks for great tutorials 😍😍
@saqibhussainvlogs
@saqibhussainvlogs 28 күн бұрын
Chai Aur Code & Sheryians Apni Efficiency Dikhane K Chakar Mai Beginners Ko Bhool Jatay Hain, But This Guy Is Loyal For Beginners Who Have Zero Knowledge
@swapnilmohanty4045
@swapnilmohanty4045 3 ай бұрын
I have been looking for tutorials for setting up http server and this video is mind-blowing. It's so easy and helpful. Best one for starting this topic in my opinion, Hats off Piyush Sir.
@ganeshghode5595
@ganeshghode5595 7 ай бұрын
Mind blowing #Node.js series On the KZbin ❤❤❤❤❤❤❤
@abhishekparmar5207
@abhishekparmar5207 6 күн бұрын
Great work, 🎉🎉🎉🎉
@shinzo007
@shinzo007 5 ай бұрын
Bro this is the best video on the http web server. Best content 👍🏻
@kartikking7
@kartikking7 Жыл бұрын
One of the most underrated channel
@aanchalpani198
@aanchalpani198 3 ай бұрын
Hi piyush when i m doing the log file why the date is not showing me there in log file can uh just tell me please
@sadruddinhasnani3610
@sadruddinhasnani3610 14 күн бұрын
Piyush bhai, Jo aapka way to give learning he especially for beginners, really appreciate, great respect, salam from karachi
@khanhsb15
@khanhsb15 2 ай бұрын
Great tutorial ! Can you tell me what is the Theme used in VS Code in the video?
@nandjijayaswal3077
@nandjijayaswal3077 11 ай бұрын
Excellent teaching style and well explained ! Thanks Sir .
@divyarajsinhrana6045
@divyarajsinhrana6045 Ай бұрын
Any database operation is blocking or non-blocking request ?
@mma-dost
@mma-dost Жыл бұрын
sir can we have a one video first and then you can upload daily videos of that . Then same for express and mongo db and then a project video with mern good project you explain like no other 🙏🙏
@rudraprataprao5823
@rudraprataprao5823 2 ай бұрын
Excellent Video Piyush Bhai :) Thanks a LOT.
@tanmaychhabra8721
@tanmaychhabra8721 2 ай бұрын
@Piyush Garg Totally love the way you teach and explain the concepts. Please keep up this good work as it will help so many like me to understand the concepts clearly ❤.
@saniafatiama
@saniafatiama 6 ай бұрын
Bestest palylist ever .. Thanks allot for sharing your amazing knowledge with us
@RahulGupta-t7b
@RahulGupta-t7b 7 ай бұрын
Yes in req. header we can find out the ip of user , x-forwarded is method to findout the ip
@spdwivedi5925
@spdwivedi5925 5 ай бұрын
Sahi video banate ho bhaiya aap to
@BhagatBhutale..
@BhagatBhutale.. 8 күн бұрын
🔴hello aap Extension konsa use kr rhe ho please ....🔴 Muze Recomendation show nhi ho rha hai VS code me .. Please Extension name tell me
@zainabasifali1995
@zainabasifali1995 Ай бұрын
Best explanation ever had.
@AnmolThakur-vv9lf
@AnmolThakur-vv9lf 8 ай бұрын
Understood everything very grateful for this amazing content.
@pratappadhy2005
@pratappadhy2005 4 ай бұрын
Thanks Piyush. What code completion extension you are using?
@nipunjain1142
@nipunjain1142 7 ай бұрын
Please koi Nodejs ka open source project suggest kriye.. agar saath mai angular bhi ho to best rahega
@shamshad3971
@shamshad3971 Жыл бұрын
Excellent teaching! Thanks alot!
@letstry2854
@letstry2854 7 ай бұрын
Thanks sir jee, I really enjoyed and learnt via your videos!!
@ArunaTeacher-fr5uz
@ArunaTeacher-fr5uz 6 ай бұрын
Easy explanation 🎉
@CopyCoderX
@CopyCoderX 26 күн бұрын
Great respect for great mind❤❤❤❤
@jatilyadav4000
@jatilyadav4000 Жыл бұрын
Amazing video
@pankilchoudhary1648
@pankilchoudhary1648 7 ай бұрын
sir server tho express ke throw bhi bna sakte hai na ??? please clearify my douth
@souravkumar961
@souravkumar961 4 ай бұрын
Thank you so much for the excellent explanation
@Pawan-km8zz
@Pawan-km8zz 8 күн бұрын
Just love you brother
@sandip5507
@sandip5507 9 ай бұрын
@Piyush Garg which theme are you using in vs code i really liked it can you tell?
@ankit0225
@ankit0225 3 ай бұрын
00:02 Creating an HTTP web server using NodeJS 02:07 Creating HTTP server using NodeJS. 04:11 Handling requests and sending responses in NodeJS 06:09 Setting up a callback function for starting the server 08:05 Headers provide extra information about the request. 10:09 Building HTTP Server in NodeJS 12:19 Creating a log for web server requests 14:25 Creating multiple pages using switch case on request URL. 16:29 Always support non-blocking requests for better performance Crafted by Merlin AI.
@ShivendraPratap524
@ShivendraPratap524 Жыл бұрын
Done Sir before starting express, can there be a project video only using nodejs..
@mma-dost
@mma-dost Жыл бұрын
great
@yadvendra84
@yadvendra84 4 ай бұрын
Very informative videos good tutorials
@techy912
@techy912 Ай бұрын
Bhaiya Love your content 😍😍
@techy912
@techy912 Ай бұрын
Thanks you bhaiya
@pkyadav6230
@pkyadav6230 11 ай бұрын
excellent sir.😍🤑..but we need more detailed or advance things than this if possible and if ppt could be there using which we can visual the things ....
@poolman7786
@poolman7786 Жыл бұрын
which is most prefer able client side rendering or server side rendering
@nachatra-sharm0
@nachatra-sharm0 8 ай бұрын
Nowadays mostly we are using is client side rendering for ex reactjs based frontend are best example for client side rendering
@D007-k4q
@D007-k4q 6 ай бұрын
sir i have one doubt those auto suggestion like fs.appendFile is not coming can you give some suggestion how to do it on my vs code PL!ZZ !
@sen-surajit
@sen-surajit 3 ай бұрын
Excellent bro 👍❤
@mohsinabbassayyed9610
@mohsinabbassayyed9610 Жыл бұрын
I am facing that issue, even server is running at post in terminal but in browser its telling that local host refused to connect though my firewall is off
@dpxy1599
@dpxy1599 10 ай бұрын
Bhai tu hi job dilaega mujhe toh
@sandeepaksingh9248
@sandeepaksingh9248 6 ай бұрын
Mujhe bhi 😂
@shivamtripathi7597
@shivamtripathi7597 9 күн бұрын
mila job bhai ?
@simranbanwait
@simranbanwait 10 ай бұрын
great explanation, Thanks bhai
@visitor_t-w3p
@visitor_t-w3p 3 ай бұрын
fantastic thank you so much :)
@vishalvishwakarma5728
@vishalvishwakarma5728 Жыл бұрын
Sir if I'm not wrong can we install nodemon package. If we start the server using nodemon Then we don't need to run the server again and again if we are making any changes in code
@MillionaireBull
@MillionaireBull Жыл бұрын
Yeah
@deeppanchal9567
@deeppanchal9567 Жыл бұрын
Very Well Explained Sir 🔥
@satyamjha-codeindwala6666
@satyamjha-codeindwala6666 7 ай бұрын
g #Node.js series On the KZbin ❤❤❤❤❤❤❤
@dishagurjar9419
@dishagurjar9419 7 ай бұрын
Server create krne ke bad terminal pr object nhi aa rha
@not_amanullah
@not_amanullah 6 ай бұрын
this is helpful ❤
@pankajdubey1123
@pankajdubey1123 5 ай бұрын
Thanks sirg for this content
@technologygadget6570
@technologygadget6570 Жыл бұрын
Kadak lecture
@AnshuKushwaha-xz8di
@AnshuKushwaha-xz8di Ай бұрын
piyush bhaiya bahut jyada hard work krna padega lg rha hai
@jagdishchoudhary7944
@jagdishchoudhary7944 9 ай бұрын
after watching this my brain started connecting the dot how nextjs work under the hood
@tusharyadav4856
@tusharyadav4856 9 ай бұрын
@15:35 if I go to homepage and then to any other, its showing "this site can't be reached" (P.S. I writing '/' also)
@LilbroGaming07
@LilbroGaming07 Ай бұрын
Of course.... In Switch case there is no two paths are there that's why showing this
@Allinone-ej9bl
@Allinone-ej9bl 16 күн бұрын
My vs code doesn’t give me any suggestions when we are writing our js code , please help us
@bhdbfhbfyefbewfb
@bhdbfhbfyefbewfb 14 күн бұрын
do u have node js installed in ur pc,
@chandrakantkamble3371
@chandrakantkamble3371 Жыл бұрын
Best video ❤
@_dimey_
@_dimey_ Жыл бұрын
sir, i started my serer but i am not able to see anything on localhost:8000 and i set the port to 8000 also server starts but doesn't work further
@piyushgargdev
@piyushgargdev Жыл бұрын
Ah, Whats the issue?
@mohsinabbassayyed9610
@mohsinabbassayyed9610 Жыл бұрын
@@piyushgargdev even I am facing that issue, even server is running at post in terminal but in browser its telling that local host refused to connect though my firewall is off
@SanchiGupta-z7i
@SanchiGupta-z7i 7 ай бұрын
i think u must kill the existing terminal by simply clicking on the option kill terminal , and start a new one so that its gets refreshed and u might get the output!
@BhagatBhutale..
@BhagatBhutale.. 8 күн бұрын
Hello please tell me Aap konsa Extension use kr rhe ho ...​@@piyushgargdev
@sukhmanjeetsingh452
@sukhmanjeetsingh452 Жыл бұрын
sir apne jo video me smjyea or is code (given below me kya difference hai) const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => { res.send('Hello World!') }) app.listen(port, () => { console.log(`Example app listening on port ${port}`) })
@linustorvalds1549
@linustorvalds1549 Жыл бұрын
video pe node built in http method use hua hai to create server, aur is code pe express use hua hai to create server
@sukhmanjeetsingh452
@sukhmanjeetsingh452 Жыл бұрын
@@linustorvalds1549 thankx
@not_amanullah
@not_amanullah 6 ай бұрын
thanks ❤
@Manishsharma-xt5ri
@Manishsharma-xt5ri 2 ай бұрын
Prabhu Ji local host nhi chal rha chrome mein
@shivamchaturvedi4183
@shivamchaturvedi4183 3 ай бұрын
Bhai ye fav icon wala kse htega
@payalkatoch4377
@payalkatoch4377 8 ай бұрын
❤❤great
@SulavGhimireeee
@SulavGhimireeee 9 ай бұрын
Thanks bro
@VikasSharma-kc2oc
@VikasSharma-kc2oc Жыл бұрын
Awesome
@hamudxd9497
@hamudxd9497 Ай бұрын
@updateshub1462
@updateshub1462 11 ай бұрын
nice
@dheeraj5624
@dheeraj5624 Жыл бұрын
Local Host not working in browser
@amankumar3639
@amankumar3639 7 ай бұрын
👍👍👍👍👍👍
@simplsurvival
@simplsurvival Ай бұрын
I am getting error at line no.5 at 12:06 anybody can help?
@varunchavda7292
@varunchavda7292 Ай бұрын
Used backticks ( ` ) instead of single quotes ( ' ) On the left side of 1 in keyboard
@knightcore4062
@knightcore4062 Ай бұрын
also can search template literals from mdn docs
@sheetalahlawat7890
@sheetalahlawat7890 Ай бұрын
Merse BCA nhi horhii 😭😭😭... Final year 🥲✌️
@ArunaTeacher-fr5uz
@ArunaTeacher-fr5uz 6 ай бұрын
🎉🎉🎉
@mohd1612yusuf
@mohd1612yusuf 4 ай бұрын
sab to theek hai lekin aapko is code ka link description me dena chahiye tha
@vishwakarma-ex1sm
@vishwakarma-ex1sm 4 ай бұрын
day-2
@AnkitKumar-pk8tk
@AnkitKumar-pk8tk 7 ай бұрын
@bunnytheweebster
@bunnytheweebster 9 ай бұрын
vid-7 ✅
@sktshahid
@sktshahid Жыл бұрын
const log = '${Date.now()}: New Request Came '; date is not added in txt file. Instead saveing like '${Date.now()}: New Request Came . Plz let me know the error if any from my side . Thanks
@csfahad
@csfahad Жыл бұрын
Use backtics (`) instead of the string (') , it's just above the tab key
@Monu55757
@Monu55757 6 ай бұрын
Great Work
@harshkumargupta_07
@harshkumargupta_07 Жыл бұрын
Whoever are getting error try this const http = require("http"); const fs = require("fs"); const myServer = http.createServer((req, res) => { const log = `${Date.now()}: ${req.url} Request received `; fs.appendFile("./text.txt", log,(err) => { if(err) throw err; switch(req.url){ case '/': res.end("Hello from HomePage"); break; case '/about': res.end("Hello from about"); break; default: res.end("404 error found"); } }); }); myServer.listen(8000, () => { console.log("Server Started"); });
@gumlaa
@gumlaa 10 ай бұрын
//try this one const http = require('http'); const fs = require('fs'); const myServer = http.createServer((req, res) => { const log = `${Date.now()}: ${req.url} New Request Received `; fs.appendFile('log.txt', log, (err) => { if (err) { console.error(err); res.end("Error processing request"); } else { // console.log(req); // Log the request object // res.end("Request logged"); // Respond to the request switch (req.url) { case '/': res.end("This is homepage"); break; case '/about': res.end("My name is flower"); break; default: res.end("404 : Page not found"); break; } } }); }); myServer.listen(3000, () => { console.log('Server is running on port 3000'); });
@adinarayanareddy3226
@adinarayanareddy3226 Жыл бұрын
nice
Handling URL's in NodeJS
20:37
Piyush Garg
Рет қаралды 95 М.
How NodeJS Works?
14:23
Piyush Garg
Рет қаралды 132 М.
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 11 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 52 МЛН
Modules in NodeJS
15:25
Piyush Garg
Рет қаралды 123 М.
Decrease Next.js Docker Image Size 15x
5:36
Frontend Basics
Рет қаралды 23 М.
File Handling in NodeJS
18:17
Piyush Garg
Рет қаралды 112 М.
NGINX Tutorial - What is Nginx
14:32
TechWorld with Nana
Рет қаралды 170 М.
Building web server with node and bun
25:22
Hitesh Choudhary
Рет қаралды 27 М.
What is REST API?
15:41
Piyush Garg
Рет қаралды 114 М.
HTTP METHODS
13:38
Piyush Garg
Рет қаралды 77 М.
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,4 МЛН
node http is beautiful
15:42
Hussein Nasser
Рет қаралды 60 М.