Это видео недоступно.
Сожалеем об этом.
Building HTTP Server in NodeJS
HTML-код
- Опубликовано: 9 янв 2023
- 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.dev
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
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!
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.
Mind blowing #Node.js series On the RUclips ❤❤❤❤❤❤❤
Bro this is the best video on the http web server. Best content 👍🏻
Excellent Video Piyush Bhai :)
Thanks a LOT.
Excellent teaching style and well explained ! Thanks Sir .
One of the most underrated channel
@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 ❤.
Bestest palylist ever .. Thanks allot for sharing your amazing knowledge with us
Best explanation ever had.
Bhai tu hi job dilaega mujhe toh
Mujhe bhi 😂
Bhaiya Love your content 😍😍
Understood everything very grateful for this amazing content.
Thanks sir jee, I really enjoyed and learnt via your videos!!
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.
Excellent teaching! Thanks alot!
Easy explanation 🎉
Any database operation is blocking or non-blocking request ?
Yes in req. header we can find out the ip of user , x-forwarded is method to findout the ip
Thank you so much for the excellent explanation
Great tutorial ! Can you tell me what is the Theme used in VS Code in the video?
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 🙏🙏
Very informative videos good tutorials
Excellent bro 👍❤
after watching this my brain started connecting the dot how nextjs work under the hood
great explanation, Thanks bhai
Amazing video
fantastic thank you so much :)
Very Well Explained Sir 🔥
Sahi video banate ho bhaiya aap to
Thanks sirg for this content
piyush bhaiya bahut jyada hard work krna padega lg rha hai
Thanks Piyush. What code completion extension you are using?
g #Node.js series On the RUclips ❤❤❤❤❤❤❤
this is helpful ❤
@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)
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
@Piyush Garg which theme are you using in vs code i really liked it can you tell?
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 ....
which is most prefer able client side rendering or server side rendering
Nowadays mostly we are using is client side rendering for ex reactjs based frontend are best example for client side rendering
Best video ❤
sir server tho express ke throw bhi bna sakte hai na ???
please clearify my douth
Please koi Nodejs ka open source project suggest kriye.. agar saath mai angular bhi ho to best rahega
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
Done
Sir before starting express, can there be a project video only using nodejs..
great
Server create krne ke bad terminal pr object nhi aa rha
❤❤great
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
!
Kadak lecture
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
Ah, Whats the issue?
@@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
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!
thanks ❤
Awesome
Thanks bro
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}`)
})
video pe node built in http method use hua hai to create server, aur is code pe express use hua hai to create server
@@linustorvalds1549 thankx
Bhai ye fav icon wala kse htega
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
Yeah
nice
Prabhu Ji local host nhi chal rha chrome mein
👍👍👍👍👍👍
🎉🎉🎉
Local Host not working in browser
I am getting error at line no.5 at 12:06 anybody can help?
Used backticks ( ` ) instead of single quotes ( ' )
On the left side of 1 in keyboard
also can search template literals from mdn docs
day-2
sab to theek hai lekin aapko is code ka link description me dena chahiye tha
vid-7 ✅
Great Work
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
Use backtics (`) instead of the string (') , it's just above the tab key
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");
});
//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');
});
nice