Your First Node.js Web Server

  Рет қаралды 538,398

Web Dev Simplified

Web Dev Simplified

5 жыл бұрын

In this video I am going to walk you through all the steps necessary to create your very first Node.js web server. We will start at the very beginning with installing Node.js, and end with a fully functioning basic web server that serves HTML documents.
Download Node.js:
nodejs.org/en/
More Node.js Tutorials:
• Your First Node.js Web...
Twitter:
/ devsimplified
GitHub:
github.com/WebDevSimplified
CodePen:
codepen.io/WebDevSimplified
#Nodejs #WebDevelopment #WebServer

Пікірлер: 434
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Here is the link to the Node.js download site. nodejs.org/en/
@andrewbailey8378
@andrewbailey8378 5 жыл бұрын
how do you get the node terminal? i cant seem to get it
@vladimirmikulic7860
@vladimirmikulic7860 5 жыл бұрын
@@andrewbailey8378 Dear, it's not "node terminal". He is on Windows and he uses a bash shell that is provided by git terminal. That "node terminal" doesn't show that it is "node terminal", it shows the process that is currently running in the terminal. In our case, it is node, because we started a node server, but it can be any other process.
@Jokamutta
@Jokamutta 4 жыл бұрын
@@vladimirmikulic7860 Some problem! I just installed Node.js and I have GIT bash terminal in Visual Code, but when I run the node app.js command it gives and error bash: node: command not found
@vladimirmikulic7860
@vladimirmikulic7860 4 жыл бұрын
@@Jokamutta are you on Windows?
@Jokamutta
@Jokamutta 4 жыл бұрын
@@vladimirmikulic7860 Yea I am
@nsharma4981
@nsharma4981 3 жыл бұрын
This was the perfect introduction to Node, you explain soo well! I just watched and understood what was happening in my first viewing, and then coded along the 2nd time. It went incredibly smoothly. Thanks a lot, Kyle. Love learning from you 😊
@timderks5960
@timderks5960 3 жыл бұрын
Kyle, I wish you made tutorials for everything in life. Always long enough to learn something, short enough for my potato-like attention span to handle, and clear enough for anyone to understand. Great stuff!
@reinanatasha888
@reinanatasha888 3 жыл бұрын
I was adamant to find a simple explanation after browsing 30+ complex tutorials for 4 days. Thank you so much for this!
@nataliegrayhandle
@nataliegrayhandle 3 жыл бұрын
Same here , exactly what i was thinking
@abdel-karimosmanuazumah499
@abdel-karimosmanuazumah499 Жыл бұрын
same here
@higherpurpose1212
@higherpurpose1212 3 жыл бұрын
Have scoured YT for a simple explanation on why I should use Node and how it serves as another web server, and you did it in 9 minutes compared to many videos explaining details we don't need initially to understand why use Node! Man! You really are a great teacher, you have that talent to explain complicated things in a very simple way!
@trentirvin2008
@trentirvin2008 4 ай бұрын
Most KZbin resources for coding are horrible about getting to the point. You get waterboarded with irrelevant esoteric information and get a convoluted explanation trying to demonstrate why something works in an abstract way, as opposed to showing you what the outputs of the code are and explaining it backwards from there. Its like they forget these lessons are for people coming in new to a concept
@johnbaxter7582
@johnbaxter7582 2 жыл бұрын
Hardly ever found a better startup tutorial on nodejs. Absolutely perfect.
@debdeepdas3092
@debdeepdas3092 2 жыл бұрын
This was the best http module tutorial. Everywhere else I just found them explaining the functions but didn't connect them with the actual web server. This was awesome! Just what I wanted! Thanks a lot!
@w00borg34
@w00borg34 4 жыл бұрын
thanks for being straightfoward. so many tutorials are unnecessarily long and complex.
@jorgepizzati1982
@jorgepizzati1982 4 жыл бұрын
This was a great start for me Kyle, very good content!
@jrr_ddp
@jrr_ddp 2 жыл бұрын
I really enjoyed all your Tutorials about web development. Because i have a background of Dot Net. When am new to wed development i started directly developed my portfolio website with minimum knowledge later realized i have not learn properly, that time i started to watch your videos that are east to understand .Now i started your full-stack development course. Am eager to follow the course. Thank you
@prasannanaik1023
@prasannanaik1023 3 жыл бұрын
My favourite channel...❤️ He teaches straight forward and no bullshit talks and very clean code... Brad traversy would be my 2nd fvt channel
@connordavis4766
@connordavis4766 2 жыл бұрын
If you're ALSO just getting started with VS code like me and you're troubleshooting: 1. Make sure the terminal type is set to git bash 2. Do not forget to SAVE before running stuff
@cowboybob7093
@cowboybob7093 Жыл бұрын
Another major thing is at 0:25 - Learn on a rock-solid version Students can waste time and get discouraged because they don't know the difference between their bugs and a buggy compiler/interpreter. I had an early Microsoft Pascal IDE that was fun to use but I wasted half my time on a few unsolvable bugs instead of a bunch of finished code. I can't even say "but in the long run I'm a better..." because what I learned was IDE specific, not general debugging.
@Rodbove4Jam
@Rodbove4Jam 4 жыл бұрын
Just found your channel, I'm a python programmer and wanting to understand more about Node.js and JS in general, your content is really good! Keep it up!
@bhaskardhanavath6650
@bhaskardhanavath6650 3 жыл бұрын
how to get the port number
@Rodbove4Jam
@Rodbove4Jam 3 жыл бұрын
@@bhaskardhanavath6650 You define the port number when using the server.listen() method, like server.listen(3000, callback). As he did on the video, you can also assign the port to a variable, say "port", and use it on the .listen() method instead.
@bhaskardhanavath6650
@bhaskardhanavath6650 3 жыл бұрын
How to get that port number like 3000 is it system port number
@agamjotsingh7371
@agamjotsingh7371 3 жыл бұрын
@@bhaskardhanavath6650 You can give any port number you want. example: 9090 , 4000, 2890 etc...
@expensivecats
@expensivecats Жыл бұрын
Haha try python flask
@CardamonKiss
@CardamonKiss Жыл бұрын
Thank you so much! VERY good tutorial and no unnecessary talking, but straight to the point! Really appreciate that and it helped me big time :)
@AlexisBradley
@AlexisBradley 2 жыл бұрын
THAT was incredibly simple BECAUSE you are an INCREDIBLE teacher, thank you!
@smithscarborough9840
@smithscarborough9840 3 жыл бұрын
So helpful and concise! Thank you so much for sharing!! You really are a gifted teacher.
@TheTricolourSaga
@TheTricolourSaga 2 жыл бұрын
You owned my respect, you got a subscriber! I wish you made tutorials for everything.
@sanilkp6180
@sanilkp6180 2 жыл бұрын
Thank you very much for sharing these tutorials. Appreciate all your efforts. It's been very helpful for me! Thank you again!
@pappucdl
@pappucdl 4 жыл бұрын
Your video was concise and right on point. Helped me understand better.
@RAP5428
@RAP5428 3 жыл бұрын
I have been subbed since I discovered this channel ♥♥ Love your vids
@borislavborisov8426
@borislavborisov8426 4 жыл бұрын
ur the best ever.Keep on making good content.Seriously this helped a lot!
@truthvfiction
@truthvfiction 3 ай бұрын
The best “hello node” type of Node.js I’ve seen yet.
@thientran-rd3qk
@thientran-rd3qk Жыл бұрын
thank you... much better than the 4-hour lecture by my teacher in the bootcamp...
@CiciliaT
@CiciliaT 3 жыл бұрын
Really easy and simple not to much nonsense for beginners ears...thanks a bunch!
@Hardik.Kalasua
@Hardik.Kalasua Жыл бұрын
This was made beautifully simple. Perfectly done. Thank you. 🙏
@SurfingTheMentawais
@SurfingTheMentawais 2 жыл бұрын
Great video as always Kyle!
@kevinhukom2394
@kevinhukom2394 3 жыл бұрын
awesome! clear and concise vid. Just what I need. Thanks
@alexsports7554
@alexsports7554 2 жыл бұрын
Thank you so much. I've been looking at a lot of videos but this one really helped!
@adiii41
@adiii41 11 ай бұрын
I love your content and comitment beeing a youtube webDev mentor. I'm on a way to become a junior fullStack and I find your videos very, very usefull. BTW im sth about B1-B2 eng speaker and I fully understand you. Cheers to your success and a bright future! :)
@AllenAndersonTaylor
@AllenAndersonTaylor 3 жыл бұрын
you rock dude. this helped me with an intranet (offline) system i'm developing for work.
@jenglish1986
@jenglish1986 2 жыл бұрын
Super vid, real quick clear presentation, good job
@akhildhiman8791
@akhildhiman8791 4 жыл бұрын
Dude you are awesome!! it was easy to understand thank you man!!✌
@chetnabansal370
@chetnabansal370 10 ай бұрын
Thanks bro my interest in coding has returned.❤
@sharathkumarhk4260
@sharathkumarhk4260 Жыл бұрын
This is really an awesome lecture!
@dudeimadolphin4318
@dudeimadolphin4318 5 жыл бұрын
congrats on 2k kyle
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thanks! I am still in shock from hitting 1k.
@w1nGsEEEhTV
@w1nGsEEEhTV 3 жыл бұрын
Now almost 400k :)
@dudeimadolphin4318
@dudeimadolphin4318 3 жыл бұрын
@@w1nGsEEEhTV for real tho lol
@dimitreortt6972
@dimitreortt6972 4 жыл бұрын
This is extremely good! Thumbs up from Brasil !! ;)
@eilayyosfan4417
@eilayyosfan4417 9 күн бұрын
Thank you for this man, you help me a lot with this video, clean and easy to do.
@stekl.h
@stekl.h 4 жыл бұрын
What a great video! Thumbs up :)
@chadzulu4328
@chadzulu4328 Жыл бұрын
Perfect explanation, thanks so much!
@user-dx8ec2dh7k
@user-dx8ec2dh7k 11 ай бұрын
Thanks! Done setup my first NodeJS server!!!
@lordofdawn6871
@lordofdawn6871 2 жыл бұрын
Wow you are a pro kyle and you explained very well! Thanks and it works 💗💗💗❤❤❤❤
@sudhangshudas3099
@sudhangshudas3099 3 жыл бұрын
Thanks a lot man for helping me out.
@cristenevillar6887
@cristenevillar6887 2 жыл бұрын
Thank you for this easy to learn tutorial
@yaswanthravuri662
@yaswanthravuri662 4 жыл бұрын
Love u broo.. u really made me to get interest in js.. thanks a lot..
@TheGamer2024Short
@TheGamer2024Short 3 ай бұрын
I love you! I searched 16 days in the internet to know to how i can render code from a file! Sorry for my bad english
@muhammadhamza3720
@muhammadhamza3720 4 жыл бұрын
Your Mad...... I loved how you explained... thankx :)
@faizalimuhammadzoda4731
@faizalimuhammadzoda4731 2 жыл бұрын
Great content. Thanks for the effort.
@olivemoon2545
@olivemoon2545 Жыл бұрын
This dude is actually so good at his job lmao.
@Dima-uz8gi
@Dima-uz8gi Жыл бұрын
Awesome! Thank you! :)
@binfloo6191
@binfloo6191 2 жыл бұрын
Awesome tutorial :)
@k_adms5406
@k_adms5406 2 жыл бұрын
Cool tutorial man. The node app.js didn't show in the Terminal at first, had to install npm then everything worked!
@oskarszageris2587
@oskarszageris2587 Жыл бұрын
Much thanks, this helped a lot
@Aalii6
@Aalii6 Жыл бұрын
very helpful, thank you!
@rcasturi55
@rcasturi55 8 ай бұрын
Thanks a lot brother. it is working. Keep it up
@christophermartinez1769
@christophermartinez1769 3 жыл бұрын
I am in love with your videos lol
@tubepankajyou
@tubepankajyou 2 жыл бұрын
Awesome work 👍
@anjulamadusanka5461
@anjulamadusanka5461 3 жыл бұрын
Really very helpful... thank you very much
@ricardonicolitoiu5906
@ricardonicolitoiu5906 2 жыл бұрын
You are a genius. thank you for this video
@SocksWithSandals
@SocksWithSandals 4 жыл бұрын
Thanks, Kyle.
@bieddruhuggyfalsaperla5447
@bieddruhuggyfalsaperla5447 2 жыл бұрын
How did you open the browser from vscode to display your output? Is the a special button in vscode, or did you just open a browser and type in localhost3000 instead of a website to get the vscode output to display in the browser?
@teneoultrius6340
@teneoultrius6340 2 жыл бұрын
Thank you bro, God bless you!
@newfoundland1956
@newfoundland1956 8 ай бұрын
SO VERY HELPFUL
@funtime1384
@funtime1384 4 жыл бұрын
this is amazing thx so much you just help a 12 years old boy that his dream is to be a programer
@warrennova2575
@warrennova2575 4 жыл бұрын
I'm younger and am already a programmer. (Please take no offense.)
@neksodebe
@neksodebe 4 жыл бұрын
@@warrennova2575 me too (same. please don't insult me)
@eirikskurdal2287
@eirikskurdal2287 3 жыл бұрын
@@warrennova2575 knowing some code doesn't make you a programmer. He's talking about programming as a career, and if he's starting at 12 he's already ahead of most of his future peers.
@sandevabeykoon2398
@sandevabeykoon2398 3 жыл бұрын
I was just born and I am a programmer
@peachok3564
@peachok3564 3 жыл бұрын
@@sandevabeykoon2398 pfff, I am a spermatozoon and i am already a Senior Software Engineer at the Google
@Navedkhan-rd2qu
@Navedkhan-rd2qu 3 жыл бұрын
It was a great tutorial.....It will be great if you could make a video on how to structure a nodejs backend. Since i could not find it anywhere . Thanks
@jamil_mikael
@jamil_mikael 3 жыл бұрын
thanks yo !! you help me a lot
@iamyawaka7020
@iamyawaka7020 Жыл бұрын
That was quick? WOW!
@gunapawan4948
@gunapawan4948 4 жыл бұрын
really good thank you soo much
@narikumar
@narikumar 2 жыл бұрын
Nice video, thanks a lot
@zhihangzhou7141
@zhihangzhou7141 2 жыл бұрын
nice hair style and nice code!
@cezarygruca9823
@cezarygruca9823 3 жыл бұрын
The good and the simple one!
@josht7238
@josht7238 2 жыл бұрын
thanks so much very helpful
@user-ue2qx9pl5c
@user-ue2qx9pl5c Жыл бұрын
it's Awesome bro!
@Tubeman777
@Tubeman777 5 жыл бұрын
Cool to know this manual method. The Live server Extension on VS Code works in the same way right?
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Not really. Live server just sets up a really basic server but doesn't allow you to do any server side code with it. Node.js on the other hand allows you to write a ton of custom server side code.
@MahadyHasan
@MahadyHasan 3 жыл бұрын
you really Simplified the nodejs. Do you have any plan to create a nodeJS Crash Course?
@NasuKasha
@NasuKasha 3 жыл бұрын
you saved my day!
@RadhaKrishna_777
@RadhaKrishna_777 3 жыл бұрын
Helpful video 👍😘
@cr7forever7877
@cr7forever7877 Жыл бұрын
great video. thanks. And what is your keyboard model and switches
@yasmeinSalem44
@yasmeinSalem44 3 ай бұрын
it's amazing explaination, but I have a question; why did you write res.writeHead(200, { content-type: "text/html"}) outside the callback function, not inside the else statement?
@jessicasepulveda7463
@jessicasepulveda7463 Жыл бұрын
You are a GOD! Thank you
@bblz9171
@bblz9171 4 жыл бұрын
Little late to the party, but I recently began making webservers with NodeJS. Now I heard people talking about that you never use NODEJS as the http webserver? Is that true that you need something like nginx or Apache? And did you make a video on that?
@stephanieb8374
@stephanieb8374 2 жыл бұрын
Hi Kyle, Thanks for the great video. How would you change it so that the file is not read at every request? (if there's a million users and it reads file every time, it will make it slow)
@marcio9161
@marcio9161 Жыл бұрын
Grande Wesker!
@christenw.1726
@christenw.1726 2 жыл бұрын
Wow thank you!
@AlexCio
@AlexCio 3 жыл бұрын
nice one! 🙂👌🏿
@embeddedbastler6406
@embeddedbastler6406 3 жыл бұрын
Just for my understanding: what is the difference from this to webservers like nginx or Apache?
@limyensoon6189
@limyensoon6189 4 жыл бұрын
This is Awesome!!!!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thanks!
@samarmohan9891
@samarmohan9891 3 жыл бұрын
You are a king
@DA-gs2rl
@DA-gs2rl 4 жыл бұрын
I wonder how you add URLs. Great video! Nice and simple just like I like it. Thanks.
@caelim3524
@caelim3524 3 жыл бұрын
What do you mean "add URLS"? do you mean to link something in the site or to deploy the website onto a hosting platform?
@patriotuz_
@patriotuz_ Жыл бұрын
Thank you very much
@thamudhifernando4220
@thamudhifernando4220 24 күн бұрын
thanks. its works 👍
@yousefz.9309
@yousefz.9309 2 жыл бұрын
Thanks man 👍👍
@kieuvantruyen1974
@kieuvantruyen1974 5 жыл бұрын
good video for beginer
@WebDevSimplified
@WebDevSimplified 5 жыл бұрын
Thank you!
@gracehu3031
@gracehu3031 Жыл бұрын
thank you!!: D
@bedrockcoder5169
@bedrockcoder5169 4 жыл бұрын
NodeJS is my life
@chunwaiwong5355
@chunwaiwong5355 3 жыл бұрын
May I ask why the res.end() in 8:33 will be put inside 'readfile' function instead of the create server function? Thanks a lot!
@Noah.Nation
@Noah.Nation 3 жыл бұрын
It's because it takes a second for the 'readfile' function to load the file contents, so we don't want to end it before it finishes reading the file. The 'readfile' function doesn't run until the file contents have been loaded, so anything inside of it won't run until it's finished reading the file. If we didn't do this, the 'res.end' function would run before the 'readfile' function and that would cause it to error.
@oskarkottom8365
@oskarkottom8365 2 жыл бұрын
Thx for the video can I just ask is there a way to make it auto refresh?
@blue-obsidian
@blue-obsidian Жыл бұрын
I Remember when you where at 104k Subs
@gkarapeev
@gkarapeev 4 жыл бұрын
Fuckin A. Lean and minimal - perfect for a beginner - no distracting BS!
@codingworld1082
@codingworld1082 3 жыл бұрын
How should we setup node in production live server. Installed node using ssh but not get my view page in url. Is there any modification on htaccess to use node ui render
@Seldoon182
@Seldoon182 3 жыл бұрын
Great tutorial! Then I added a script tag to call a anther javascript file to play around but I had the error "Uncaught SyntaxError: Unexpected token '
@binadarabzand2701
@binadarabzand2701 3 жыл бұрын
I am having the same problem. And it shows that my HTML tags like is the cause of that! Crazy!!!
How To Setup Payments With Node.js And Stripe
55:33
Web Dev Simplified
Рет қаралды 288 М.
Learn Express JS In 35 Minutes
36:03
Web Dev Simplified
Рет қаралды 746 М.
Who’s more flexible:💖 or 💚? @milanaroller
00:14
Diana Belitskay
Рет қаралды 18 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 2,5 МЛН
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 29 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 25 МЛН
Build Node.js User Authentication - Password Login
13:31
Web Dev Simplified
Рет қаралды 504 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 77 М.
Web Server Concepts and Examples
19:40
WebConcepts
Рет қаралды 226 М.
Passing Data Between Frontend and Backend | Node.js
18:31
Smoljames
Рет қаралды 81 М.
How a DNS Server (Domain Name System) works.
6:05
PowerCert Animated Videos
Рет қаралды 4,8 МЛН
Who’s more flexible:💖 or 💚? @milanaroller
00:14
Diana Belitskay
Рет қаралды 18 МЛН