Тёмный

Node.js Crash Course 

Traversy Media
Подписаться 2,3 млн
Просмотров 1,6 млн
50% 1

Updated Version - • Node.js Crash Course
In this crash course we will explore Node.js fundamentals including modules such as path, url, fs, events and we will create an HTTP server from scratch without Express and deploy to Heroku.
Watch Next: Express Crash Course:
• Express JS Crash Course
Sponsor: DevMountain Bootcamp
goo.gl/6q0dEa
Code:
github.com/bra...
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Courses
www.traversymed...
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,6 тыс.   
@revillsimon
@revillsimon 5 лет назад
“If you watched until the end, I appreciate it.” How could I not watch this until the end? Every video from you is GOLD, Brad. Thank YOU!
@kasunshashi
@kasunshashi 3 года назад
Agreed
@phat80
@phat80 3 года назад
I watch every second video from this channel just to the midde as it usually gets very boring. Some videos are good, some not.
@bongumusamusambuli8195
@bongumusamusambuli8195 3 года назад
True 100%
@suganganesan1999
@suganganesan1999 3 года назад
Just what I was feeling
@adrienconversanodbl_g5119
@adrienconversanodbl_g5119 2 года назад
Totally agree, I watched until the last minute
@pedrobatista7975
@pedrobatista7975 4 года назад
"If you stayed to the end, I, genuinely, really appreciate that... I really do! If you can spend an hour and a half watching a video of mine I really appreciate that..." - man, I didn't spent just an hour and a half here! I was watching it through the course of like, ten/fifteen hours. I was testing the features you were presenting, doing little experiments, reading the documentation and watching other videos. I can say that your video is a good study guide.
@KiaanCastillo
@KiaanCastillo 5 лет назад
okay this is crazy. THE MINUTE I REALIZE I NEED TO LEARN NODE.JS ASAP AND YOU MAKE THIS VIDEO. THANK YOU BRAD!! 🙌🙏🔥
@TheFogOfWar1wvdm
@TheFogOfWar1wvdm 5 лет назад
Exactly what i needed!
@mastapegs
@mastapegs 5 лет назад
I was feeling the SAME WAY!!
@iDriftDaily
@iDriftDaily 5 лет назад
Yes. Mind blown. Can't wait to make to make whatever I want now
@zlatankazlagic6799
@zlatankazlagic6799 5 лет назад
same
@geekyforever2005
@geekyforever2005 5 лет назад
Same here :D
@andrewbrower4158
@andrewbrower4158 3 года назад
This tutorial is amazing. I love that Brad takes the time to explain the fundamentals, which are skipped over by others all too often. Whenever someone is wanting to learning programming, Brad is always one of the very first I recommend. Thank you for your awesome work, Brad!
@FabricioEGiovanni
@FabricioEGiovanni 5 лет назад
Thank you very much for this flawless service to the dev community, Traversy. You are surely one of the best professors I ever had.
@BekBrace
@BekBrace 4 года назад
I stayed the whole one hour and half watching typing and learning, and I thank you for your great work done in explaining Node.js in plain English ! Thanks once again Brad and be safe
@ClevergunsYT
@ClevergunsYT 5 лет назад
I don't know how. My teacher teaches this for 3 months and u did it in an hour
@maskman4821
@maskman4821 5 лет назад
That's right, a lot of school teachers actually don't know how to teach, they just say things to kill time...
@chrissabre1761
@chrissabre1761 5 лет назад
Hes paid to stretch it out over the 3 months, and cover a curriculum
@ClevergunsYT
@ClevergunsYT 5 лет назад
And to think he's not a college grad, vs my prof who are in masters degree. He's the absolute good teacher.
@rosselliot8971
@rosselliot8971 5 лет назад
Work expands to fill the time allotted. If your teacher was paid per student qualified per time taken, well, that would be different.
@maximilianotorres1225
@maximilianotorres1225 5 лет назад
Yeah, it sucks how some teachers give you a lot of theory, while Brad goes to the point.
@rongtoob
@rongtoob 2 года назад
You are an amazing teacher! I'm trying to learn this stuff and you've been the only person that has explained it in terms I'm able to grasp! Great job!😁
@marcosfraticelli4225
@marcosfraticelli4225 2 года назад
Not only a great theoretical and technical stuff, also a great accent to non native English speakers. I really appreciate this video!
@nabil14409
@nabil14409 4 года назад
Using the quarantine time after this. Thank you, Brad. Stay safe.
@ianpaul0520
@ianpaul0520 4 года назад
yeah, there is no excuse now...
@kbcarte420
@kbcarte420 4 года назад
I bought a couple of his courses on Udemy while they're on sale too.
@RustyRustacean
@RustyRustacean 4 года назад
@@kbcarte420 wait, did you ever see udemy without the discount of 99.99999% for only 2 days??
@davidmuhsin1895
@davidmuhsin1895 4 года назад
41:25 Brad pc up for 15 days, get some sleep ;)
@luckylove72
@luckylove72 4 года назад
anything overused is unattractive. like ur comment.
@punkgrl325
@punkgrl325 3 года назад
So awesome. This is the first tutorial that got me understanding how node is actually used to build and deploy apps. Every other tutorial I came across just claims as long as you understand javascript then node is easy, briefly explain what npm and modules are, and then jump right into express. By contrast, this one really broke down how the core modules actually apply to building a server without express. What a gem. Thanks, Brad!
@wolvincraft9932
@wolvincraft9932 2 года назад
This was the most amount of information that I've seen packed into a one-and-a-half-hour video. It took me several hours to fully digest. The video was exceptionally thorough and helped me understand the subject.
@jackiemcgough2997
@jackiemcgough2997 Год назад
I stayed too the end! You pushed the site to herouku. I just started programming and I'm a CS student at 32.
@anthonywright4168
@anthonywright4168 2 года назад
I use your videos as pre-cursors for current topic of the boot camp that I am in. Your videos are essential to me succeeding. Just watching a video before I have to read/research a topic makes it so much easier for me. Thank you so much!
@alexmerz4084
@alexmerz4084 5 лет назад
Amazing video, Brad. I totally enjoyed it! The fact that you go through few of the most basic modules says a lot about you approach of teaching in general and I absolutely love. It was refreshing to see a minor nodejs reference work rather than an explanation by means of an example project. You are one of the best programming teachers for sure!
@zenitzo
@zenitzo Год назад
4 years later and its still one of the best node js videos ive seen, thank you king
@saqlainalvi3333
@saqlainalvi3333 3 года назад
I have an interview on nodejs in a few days. No idea what the hell node even is. Brad to the rescue!!
@CEOofTheHood
@CEOofTheHood 3 года назад
Did u pass it
@prakharmathur619
@prakharmathur619 Год назад
Purchased your express masterclass course, but before this was a necessacity. Thank you so much for all you have done for us. I have learned a lot from you. Thank you!!
@TinyMaths
@TinyMaths Год назад
If anybody is struggling with this, especially on Syntax, if you haven't already gone through a short course on ES6, you might find that helpful. Brad mentioned that at the beginning and because I was totally confused I went away and spent a few hours learning ES6 and other things he suggested. For me, it made understanding the functions and methods in this tutorial significantly less difficult. Anyway, this node JS is fascinating; I was apprehensive about taking this course because on first viewing it was like 'Greek' to me. So glad I came back. Can't believe some of the methods it has; like giving you the ability to get system information. It's almost tempting to try to build one of those applications you see online that show you system information - I always wondered how that works. NEVER in my life would I have imagined considering trying a project like that. This JavaScript stuff is truly a rabbit-hole.
@solomonseidu4435
@solomonseidu4435 8 месяцев назад
This video is over 4 years old, is it still ok to watch and learn or...
@TinyMaths
@TinyMaths 8 месяцев назад
@@solomonseidu4435 I think that, in terms of simplicity, it is quite a good place to start. If you scroll down and read some of the comments from about a year ago, there is some very positive feedback, so I guess the video is still relevant. I must admit though, a few parts were confusing to me because I was a complete beginner, so I had to watch other videos alongside this one, and, as I said above, I had to learn the basics of ES6, which made the course easier after that. Another Node tutorial which I think goes well with this one is from the channel named 'Programming With Mosh' , he has a very good one-hour video for learning node, which might be even more beginner friendly (if that's where you're starting). I went back and forth a lot between the two.
@BrendanMcNerney
@BrendanMcNerney 2 года назад
Hey this was great. As a front-end dev for many years, this answered a lot of questions I'd had about how one deploys an app vs building a traditional web page etc. so thank you!
@RyanSmith-qb6dl
@RyanSmith-qb6dl 5 лет назад
Dude not only did I watch till the end, I coded along! You have the best tutorials ever! Please do more! LOVE IT!
@raf2518
@raf2518 5 лет назад
video was awesome, learned a lot. Will be using it to create an api that holds images urls, not sure if this is the best way to go about but I am new to backend and figured this can serve as practice lol once that is completed I'll share the github repo and move on to your express video! thanks!!
@raf2518
@raf2518 5 лет назад
here is the api I created with the help of this video: guarded-mountain-69076.herokuapp.com/ and here is the app I made that uses it: raf-car-audio-meme-generator.netlify.com/ There is no need for the api lol I could've easily created an array inside my app but I wanted to practice using node to serve files. THANKS AGAIN!
@ConorBailey
@ConorBailey 5 лет назад
Brad. Thank you so much for your work. I feel I have learned so much from your channel and courses. You're a legend.
@shivansh901
@shivansh901 3 года назад
You're the best online teacher and the inspiration Mr. Brad, thanks for making such quality content.. appreciated a lot. love from India
@shivanigaddagimath2143
@shivanigaddagimath2143 3 года назад
Hello Shivansh! Are you a fresher or a working professional? Would you be open to exploring job opportunities in web development currently?
@shivansh901
@shivansh901 3 года назад
@@shivanigaddagimath2143 Hi Shivani, I'm a self taught developer, and looking for opportunities to shine up my skills in same line
@shivansh901
@shivansh901 3 года назад
@@shivanigaddagimath2143 I didn't know RU-vid automatically delete comments with links, cause I replied to your msg yesterday with my LinkedIn profile link
@shivanigaddagimath2143
@shivanigaddagimath2143 3 года назад
@@shivansh901 Yes, that happens sometimes. You can find the link to my LinkedIn on my channel. Please connect with me to know more about this opportunity.
@himanshunahak5105
@himanshunahak5105 4 года назад
Watched this video till the end and indeed thanks to you Brad for being there for US!! You dont know most of us but we all connect with you like one of our own mates.. Thanks Brad!! ♥ from India!
@MoatazSaber96
@MoatazSaber96 3 года назад
“If you watched until the end, I appreciate it.” I mean , I am the one who who should be thanking you man , you're the one helping me , all the love in the world man thank you
@Knowledge949
@Knowledge949 5 лет назад
Man, u r unstoppable. I know how much of energy we need to learn and prepare a course. All the best for ur future dear brother.
@jamesmalarkey7437
@jamesmalarkey7437 3 года назад
Brad I discovered your channel 3 days ago and my life changed a lot since because of you, just wanted to say I'm really*1000 grateful.
@B20C0
@B20C0 3 года назад
33:27 if anyone wonders why the file got created despite the error: That's asynchronous functions in a nutshell for you. While asynchronous programming makes your programs execute a LOT faster, this type of behavior might happen, just keep it in mind. So basically if you do this: somefunctionA(); somefunctionB(); If you run those asynchronously and if B relies on A being done, and B is faster than A, you will run into errors.
@Couchwurst
@Couchwurst 4 года назад
I was honestly frightened of all that server side stuff, so i postponed working through this video a lot. But you, Mr. Traversy, did such a good job! Watching this video i realized it is not too difficult. Now i have a structured understanding of the basics and the motivation to dig deeper. Thank you!
@ChaosEmerald85
@ChaosEmerald85 5 лет назад
Thanks for all your hard work on these tutorials, Brad. You're awesome
@aldrinmabanta
@aldrinmabanta 4 года назад
Brad is an amazing presenter which makes a great teacher. You can just upgrade him as a mentor. He comes right thru the learning mind. Straight to the point. Clean code. Totally awesome. I'd buy you a drink just cause!
@kunaljt
@kunaljt 5 лет назад
Just finished the react crash course yesterday, and was looking for one. Awesome timing, thanks!
@CongTuyenLe
@CongTuyenLe 5 лет назад
same
@skylar1112
@skylar1112 4 года назад
Brad, thank you for this video, I'm going through a bootcamp right now, learning Node, my instructor is quite good. His teachings and you gave it an extra dimension that I needed. Keep up the good work.
@zuoqizhao2706
@zuoqizhao2706 5 лет назад
One of the best free tutorial videos I've ever seen! Thank you Brad !
@soni.himansh
@soni.himansh 2 года назад
Best NodeJs Video out there on RU-vid, So simple yet so informative, love how calmly you teach. Appreciate it, Brad.Thanks.
@iali3903
@iali3903 5 лет назад
Brad always make me happy !
@rock123458951
@rock123458951 4 года назад
Took 2 days to watch it completely while simultaneously doing it. Thank you, Sir.
@shivanigaddagimath5994
@shivanigaddagimath5994 3 года назад
Hey Shubham! Are you a 2021 passout? Would you be interested in exploring job opportunities in web development currently?
@JamieDawsonCodes
@JamieDawsonCodes 3 года назад
1:22:37 If the about page is giving the 404 page not found, be sure to add this line of code under the switch statement: if (contentType == 'text/html' && extname == '') filePath += '.html';
@TomTomDam
@TomTomDam 3 года назад
Thank you!
@RezHimself
@RezHimself 2 года назад
Honestly , i love the way you teach , there were a lot of things that i couldn't understand till i found your channel , you helped me to achieve my goals and dreams ( being a web developer ) at this moment nothing can express my appreciation , thanks Brad . ✍️♥️
@allex3842
@allex3842 5 лет назад
I was just looking through your old node js crash course and the notification for this came. Thanks for the great content
@kenkioqqo
@kenkioqqo 3 года назад
Watching your tutorial has really had a great impact on my confidence as a JavaScript developer. I started watching your videos in early 2021, with no knowledge of what a function or loop is, and now, am already able to create basic apps like calculators and interactive web elements with HTML, CSS and JS. Thanks a million, Brad.
@lektimsina2132
@lektimsina2132 5 лет назад
was waiting this one from you, Brad. We want more node.js tutorial videos.
@eQ-13
@eQ-13 3 года назад
Even two years down the line, we still watch to the end Brad. That's the quality of your content. Bravo.
@Easyman01
@Easyman01 4 года назад
I can't thank you enough Brad, I truly appreciate your effort and commitment teaching us. Thanks again man.
@khalifmahdi
@khalifmahdi 4 года назад
I watched it during quarantine and started a project based on Node JS. Really loved your video! Good job! Thanks a lot! Following you from Iran. Stay safe Brad!
@samuelemancuso9855
@samuelemancuso9855 5 лет назад
Time flew by, flawless tutorial. Thank you!
@nitika1111
@nitika1111 3 года назад
Watched it till the end... Can't thank you enough for the hard work you've put in this and all other videos... Thanks again :)
@shivanigaddagimath2143
@shivanigaddagimath2143 3 года назад
Hello Nikita, are you a 2021 passout and interested in full-time positions in fullstack development?
@BalduinoFernando
@BalduinoFernando 5 лет назад
This year I gotta learn JS technologies... And This is the right place for me...
@lycan2494
@lycan2494 4 года назад
nigga where u at now
@VinyZikss
@VinyZikss 4 года назад
he's from Angola
@paristar3079
@paristar3079 4 года назад
@@VinyZikss How do you know that?
@paristar3079
@paristar3079 4 года назад
@@lycan2494 Please, No Racism at least in this channel
@VinyZikss
@VinyZikss 4 года назад
@@paristar3079 I mean, he's black and portuguese speaker, so probably from Angola, Mozambique or Brazil
@topDragon-f9t
@topDragon-f9t 3 месяца назад
holy smokes, that was crazy value. I went from knowing absolutely no node to deploying a server app. Thanks for the content man!
@miles611
@miles611 3 года назад
Brad always delivering incredible content. Really appreciated, man!
@vijayprem271
@vijayprem271 3 года назад
Thank you very much for this tutorial. I am completely new to Node and in fact I was learning your front end java script thru udemy and accidentally landed on this video.I realized your Voice was very familiar :) and found that's you. I like all your videos and they are very practical and right on target. I am very glad as your tutorials are answer to most of my questions.
@sadiqumar18
@sadiqumar18 5 лет назад
I need to like this before i start watching 🤗🤗
@UstadJi
@UstadJi 5 лет назад
I Always Like His Videos Before Watching ;)
@johnnydriesen7575
@johnnydriesen7575 5 лет назад
@@UstadJi So do I :)
@md.akib5124
@md.akib5124 5 лет назад
count me too
@phee3D
@phee3D 5 лет назад
more like you need to comment that you will like the video, before you actually like the video before you start watching.
@itzcracked4880
@itzcracked4880 3 года назад
Honestly, I think that this was really great, I'm really glad I kept watching until you started the server bc I really fully understood all of the different modules that you were using bc u explained them earlier!
@tghhh19
@tghhh19 2 года назад
Thanks friend. Great video. I just started a web development bootcamp and this was assigned to us. Will definitely be watching your other vids.
@limitless9483
@limitless9483 4 года назад
i spent 2 days watching this video (4hours a day) man i appreciate everything that you do for us thanks again.
@tt9378
@tt9378 5 лет назад
Another great intro into a subject. From other comments I can see I am not the only one appreciating the effort you put into your presentations. Keep up the good work.
@abhishek_k7
@abhishek_k7 5 лет назад
27:02 "can't talk while I spell concatenate" lol
@chadpaulsen8751
@chadpaulsen8751 3 года назад
i'm a student and my instructor assigned this video for 3 assignments, great video and i'm a subscriber now!
@flow7832
@flow7832 5 лет назад
Thank you so much to make this quality course about node.js. It was a pleasure to work with you during 1 and half an hour ! I encourage you to keep making videos and learning courses. Greatings.
@Roudter
@Roudter 3 года назад
You know, when you're working...you can neglect things for a while. Your presentations are EXCELLENT...help me get standing steady again with things... You help in ways you may not have thought of. A very grateful, Thanks...
@TechNSayge
@TechNSayge 5 лет назад
Another Traversy Media smash hit! Thank you! Listen at 2x if ur a mid or intermediate moonlighter
@unknownsoul7043
@unknownsoul7043 4 года назад
Wait let's marry you are developer and your are a female, you are now my internet wife...back off guys she is mine...
@basil_b_vegan
@basil_b_vegan Год назад
I am so grateful and appreciative of your content and personality Brad!! I am 2/3rd finished with my bootcamp and just learned Node and Express this week. I have followed many of your tutorials for code along and just lecture style learning! Thank you much for your inspiration as well, sharing your story and humility and generosity. I will continue to keep learning and I hope to get my first job as a developer soon, ideally for a cool mission driven company or org.
@emmythepixi
@emmythepixi 4 года назад
Thank you for this video, Brad! This was an excellent crash course and a really great intro to Node! I appreciate that you went over a lot of the important-to-know modules with path, fs, etc. Really great base of knowledge to springboard off of. Excited to keep learning Node!
@abdlahfihri663
@abdlahfihri663 4 года назад
here is the thing Brad, I usually never ever comment or post anything, but thanks to this video I will comment maybe for the first time in my life, I do appreciate your video, thank you very much, thanks to you I just got a global idea about what node.js is and what can it do, I mainly work on react and never thought that node js can do such amazing things, THANK YOU AGAIN.
@ssk7690
@ssk7690 Год назад
You are a God disguised as a human being who has descended the earth to help pawns like me reach the 8th rank and become the desired version of ourselves. Thanks for creating these amazing tutorials. Happy holidays 2023!
@mollysoni
@mollysoni 3 года назад
thank you very much, Brad! I started learning JS with you and now that I want to expand my knowledge with another technology you are the one I turn to. I love your teaching style. Keep up the amazing work!
@conaxliu9677
@conaxliu9677 5 лет назад
Great tutorial, I've learnt a lot. Thank you! I do have a little question at 1:19:36, I think the HTTP status code to write to the header should be 404 instead of 200, even though loading of 404.html is successful, the client should actually receive 404 in case their code depends on the correct status code, isn't it?
@kenirwin5538
@kenirwin5538 4 года назад
I was wondering about this too.
@anthonydagostino7782
@anthonydagostino7782 4 года назад
If you're deploying an API, then yes probably. Here you're just serving a webpage, there's no dependent code.
@mishrajit
@mishrajit 2 года назад
I genuinely and really appreciate this crash course. To make me able to deploy my node web app on Internet on my first go.
@crazycoder-gf8ls
@crazycoder-gf8ls 5 лет назад
HI Brad ,you have made many videos advising on how to start up Web business and I think they are really useful , however there is one question you may not have answered Q: How long (in time)should it take for an "average" Web developers to complete a Web project (front and back end) from start to finish in a production environment (and get paid !) ?
@jacobgasser3093
@jacobgasser3093 5 лет назад
I'm not Brad, but it really depends. Some projects are huge, some are simple static sites.
@Super_Cool_Guy
@Super_Cool_Guy 5 лет назад
Yes I have the same question , I have been learning Web development for the past few months but I am not sure how long a web project should take in production , I don't want to tell my future clients it will take a week when in fact it could take 3 weeks , there must be a way to tell how long Web projects should take.
@Super_Cool_Guy
@Super_Cool_Guy 5 лет назад
Many potential clients also ask this question on how long will the Web project take as they may be paying by the hour ?
@Tyrone-Ward
@Tyrone-Ward 5 лет назад
@@Super_Cool_Guy It seems like you guys are looking for shortcuts. There are none! If you want to know how long it should take, just time yourself. 1. Create a full project. 2. Time how long it takes you to complete. 3. Work on getting that time shorter 4. Profit (literally)
@tabletalcatellp3390
@tabletalcatellp3390 5 лет назад
Code lines/hour. How fast are u
@alanhamid5375
@alanhamid5375 2 года назад
Brad, you are simply the best tech instructor among all! Thank you from the bottom of my heart. 🙏
@kadekeqw23
@kadekeqw23 5 лет назад
Great tutorial, as always Brad- thank you. This makes me realise how much easier life is with React.
@MahalakshmiTechTalks
@MahalakshmiTechTalks 3 года назад
Thank you so so much! I watched the video till end and feel that i have learned something very useful and you have not wasted even a single minute of time. This deserves a great appreciation!!
@shivanigaddagimath2143
@shivanigaddagimath2143 3 года назад
Hello Mahalakshmi, are you a 2021 passout and open to exploring job opportunities in web development currently?
@techbizlife
@techbizlife 3 года назад
10:53node --version 10:57npm --version 11:05node 12:10ctrl/command+c 12:20vscode 12:35npm init ❤️ Package.json Package name:(node_crash_course) version:(1.0.0) Description:node crash course Entry point:(index is) Test command: Git repository: Author: Arthur🤔 Licence: ISC 13:40npm install uuid 14:30npm install -D nodemon 15:05npm install ? 15:20delete node_modules folder,npm install,recreate node_modules folder 1:04:30 "scripts": { "start": "node index" "dev": "nodemon index" }1:05:15npm run dev 15:45❤️index.js, package-lock.json 16:10Index.js Console.log('hello from Node.js...'); node index.js/index 17:35 const person = require ('./person'); 21:35 import person from './person'; console.log(person18:06.name); 19:16 const person = person ('arthur'); const person1 = new person ('arthur' , 1); person1.greeting( ); 19:43node index 18:02node index 52:45🔴index.js const logger = require('/logger'); const logger = new logger( ); logger.on('message', (data) => console.log('called listener: ${data}')); 54:35 logger.on('message', (data) => console.log('called listener:', data));54:48node index Called listener { id:791cac09-ddd8-4e9e-8b99-bd432564b13a', msg: 'hello world' } logger.log('hello world');54:23node index 59:00dalete all const http = require('http'); const path = require('path'); const fs = require ('fs'); const server = http.createserver((req, res) => { 1:01:58console.log(req.url); 1:02:42 if(req.url === '/' ) { 1:08:25fs.readFile(path.join(__dirname, 'public', 'index.html'),(err,content) => { 1:09:35if(err) throw err; }) 1:06:35res.writehead(200, { 'content'-type': 'text/html' } ); res.end('home1:09:20content'); } ); } 1:10:10 if(req.url === '/about' ) { 1:08:25fs.readFile(path.join(__dirname, 'public', 'about.html'),(err,content) => { 1:09:35if(err) throw err; }) 1:06:35res.writehead(200, { 'content'-type': 'text/html' } ); res.end('home1:09:20content'); } ); } 1:10:30 if(req.url === '/api/users' ) { const users = [ {name: 'bob smith', age: 40 }, {name: 'John Doe', age: 30 } ]; res.writehead(200, { 'content-type': 'application/json'}); res.end(json.stringfy(users)); } 1:13:10//build file path let filepath = path.join(__dirname, 'public', req.url === '/' ? 'index.html' : req.url); console.log(filepath'); res.end ( ); 1:15:20//extension of file let extension = path.extname(filepath); //Initial content type let contenype = 'text/html'; //Ckeck ext and set content type switch (extname) { ? ? ? ? ? } //Read file fs.readFile(filepath, (err, content) => { if (err) { if (err.code == 'enoent') { //Page not found fs.readfile(path.join(__dirname, 'public', '404.html'),(err, content) => { 1:19:20//res.writehead(200, { 'content-type': 'application/json' }); res.end(content, 'utf8'); }) }else { //some server error res.writehead(500); res.end('server error: ${err.code}'); } }else {//success res.writehead(200, { 'content-type' :'text/html' }); res.end(content, 'utf8'); } ) } } } ); });1:03:20node index const port = process.env.port || 5000; server.listen(port, ( ) => console.log('server running on port ${port}') );1:02:10node index server running on port 5000 / /about localhost:5000/about 17:00❤️ person.js 20:10 //Module wrapper Function (function (exports, require, module, __filebame, __dirname) { }) 20:38console.log(__); const person = { name: 'arthur' age:1 } module.exports=person; delete above18:20 class person { constructor (name, age) { this.name = name; this.age = age; } greeting ( ) { console.log ('My name is $this.name} and I am $(this.age}' ) } } module.exports = person; 22:45 nodejs.org/dist/latest-v11.x/docs/api 23:35 ❤️./reference ❤️reference/path_demo.js cd reference node path_demo 24:05 const path = require ('path'); //Base tittle name console.log(path.basename(__filename)); //directory name console.log(path.dirname(__filename)); //File extension console.log(path.extname(__filename)); //create path object console.log(path.parse(__filename).base); //concatenate paths ../test/hello.html console.log(path.join(__dirname, 'test', 'hello.html')) 24:55node path_demo 28:50❤️ reference/fs_demo.js const fs = require('fs'); const path = require ('path'); //Create folder fs.mkdir(path.join(__dirname, '/test'), 'hello world!', function (err) { if (err) throw err; console.log('Folder created...'); } );31:40nofe fs_demo 32:20//Create and write to file fs.writeFile(path.join(__dirname, '/test', 'hello.txt'), 'hello world!', err => { if (err) throw err; console.log('File write to...'); } );33:15node fs_demo 33:45node fs_demo /test/hello.txt hello, world! 34:50//File append fs.appendFile(path.join(__dirname, '/test', 'hello.txt'), 'I love node.js', err => { if (err) throw err; console.log('File write to...'); } );35:13node fs_demo test/hello.txt hello world! I love node.js 35:30 //Read file fs.readFile(path.join(__dirname, '/test', 'hello.txt), 'utf8', (err, data) => { if (err) throw err; console.log('data'); } );36:25node fs_demo //Rename file fs.remame(path.join(__dirname, '/test', 'hello.txt), 'path.join(__dirname, '/test', 'helloworld.txt)', (err) => { if (err) throw err; console.log('File renamed...'); } );37:25node fs_demo /test/helloworld.txt hello world! I love node.js 38:00🔴 reference/os_demo.js const os = require ('os'); //Platform console.log(os.platform( ) );38:38node os_demo, darwin,the platform for mac //CPU Arch console.log(os.arch()); //CPU Core info console.log(os.cpus) ); //Free memory console.log(os.freemem) ); //Total memory console.log(os.totalmem) ); //Home dir console.log(os.homedir( )); //Uptime console.log(os.uptime( )); 41:30🔴 reference/url_demo.js const url = require ('url'); const myurl = new url(linuxandroid.xyz/hello.html?id=100&status=active'); //serialized URL console.log(myurl.href);42:50node url_demo console.log(myurl.tostring( )); //Host (root domain) console.log(myurl.host); //Hostname (44:00does not get port) console.log(myurl.hostname);43:40node url_demo44:05 //Pathname console.log(myurl.pathname)); //Serialized query console.log(myurl.search); //params object console.log(myurl.searchparams); //Add param Myurl.searchparams.append('abc', '123', ); console.log(myurl.searchparams); //Loop through params myurl.searchparams.foreach((value, name ) => console.log('${name}: ${value}')); 47:10 nodejs.org/dist/latest-v11.x/docs/api/events.html 47:45🔴 references/event_demo.js const eventemitter = require ('events'); //Create class Class myemitter extends eventemitter { } //Init object const myemitter = new myemitter( ); //event listener myemitter.on('events', ( ) => console.log('event fired!')) //Init event myemitter.emit('event');49:35node event_demo event fired! 50:05🔴logger.js const eventemitter = require ('events'); const uuid = require ('uuid'); console.log(uuid.v4()); class logger extends event emitter { log(mog) { //Callevent This.emit('message', { id: uuid.v4( ), msg }); } } module.exports = logger; 56:00🔴 reference/http_demo.js cd reference const http = require ('http'); //Create server object http.createserver((req, res) => { //Write response res.write('hello'); res.end( ) }).listener(5000, ( ) => console.log('server running...') );57:43node http_demo server running... localhost:5000 hello world 58:20ctrl+c cd .. 1:07:20🔴 public/index.html, public/about.html public/index.html 1:18:10🔴 Public/404.html 1:25:20 heroku.com heroku --version 1:26:20heroku login Email Password 1:26:45 git-scm.com git --version 1:27:10 🔴node_crash_course/.gitignore node_modules reference logger.js person.js 1:27:45 git init git add. git commit -m 'initial commit' heroku create meadow-87507.git ? git push heroku master heroku open
@rahulsyt_
@rahulsyt_ 2 года назад
*le Traversy Media - Am I a joke to you ??
@alexispell4251
@alexispell4251 4 года назад
i know, you might even will not see this comment, but i'd like to appreciate you for spending your time, energy and minds in a lot of people all over the world. Your difference from another tutors in 2 main facts: -You give all the info very understandable and interesting -And after your i feel "Wow, i want to learn more!" instead "damn, i dont get this at all" Heartly appreciate from Russia and all my heart to you, man! Keep going your way!
@andrewartekha
@andrewartekha 5 лет назад
Thanks for knowledge that you're putting out. Can you please create a course about nest.js? Like it so Brad could see.
@TraversyMedia
@TraversyMedia 5 лет назад
Nest is definitely on the list
@infinityApologeticsClips
@infinityApologeticsClips 3 года назад
I love this channel, thank you Brad.
@chrisyates7060
@chrisyates7060 5 лет назад
Dunno about y'all but I DID the homework at 55:28. Star Student 😁
@thesavagesalmon9464
@thesavagesalmon9464 5 лет назад
WHAT!? ARE YOU CRAZY!?
@pranavkastury9610
@pranavkastury9610 3 года назад
Can you post your code, I kinda tried but its throwing an error.
@3rdfloorParis
@3rdfloorParis 4 года назад
Excellent video and very approachable for non regular coders (or old folks like me that use to code a while ago!). Thank you
@crustindanglade6036
@crustindanglade6036 5 лет назад
This tutorial was amazing, truly you are a lifesaver. On to your video on react!
@marcelgonzalez1376
@marcelgonzalez1376 Год назад
Amazin content. It took me 2 days to watch and learn the whole 1 and 1/2 hours of content. I bought the full Node.js from your website to take what I learned here and expand on it.
@TechnoSparkBigData
@TechnoSparkBigData 5 лет назад
Thanks Sir for all these videos. You are a great inspiration to me. Could you please make a video on firebase.
@maskman4821
@maskman4821 5 лет назад
me too, I have been expecting firebase crush course for very long time...
@algife
@algife 2 года назад
I'm recommending this kind of crash courses from you to other peers starting their journey! AMAZING job man! Thanks!
@m00nbek61
@m00nbek61 4 года назад
41:19 Brad's iMac's uptime 15 days, wow
@robahas
@robahas 4 года назад
Very well done. It stays focused, does not introduce too many concepts at once, and every step can be followed by simply paying attention.
@lardosian
@lardosian 5 лет назад
Hey Brad, might be a broad question but if you were told in the morning you can only use one stack what would you pick, ie React/View for FE, Node/Django/PHP for BE, SQL/noSQL for your database, I know project requirements might determine that but just kinda interested what are your favourite tools.
@TraversyMedia
@TraversyMedia 5 лет назад
lardosian oh you guys and your crazy questions 😏 like you said the project is crucial but for me if i were building something very important not just a little side project I would probably go with MERN. If it were an app with a lot of resources and relationships i may go with sequalize and postgres instead of Mongo.
@lardosian
@lardosian 5 лет назад
@@TraversyMedia Thanks Brad. 👍👍
@roseboutique-womensalterat1216
@roseboutique-womensalterat1216 3 года назад
thank you so much, you saved my life in my cloud app dev course!!! I didn't know how to set the content-type of different extensions, and you taught me exactly that!. Thanks again, really grateful.
@sidforreal
@sidforreal 5 лет назад
can you do a Tensor Flow udemy course...I am interested in that.
@sergius4691
@sergius4691 3 года назад
I honestly can't stand watching videos for this long. Yours are different and more understandable. Thank you!
@lardosian
@lardosian 5 лет назад
when i write os.cpus i get back ' ZX Spectrum 128k, your cassette deck needs heads cleaned'.
@mohammedansari818
@mohammedansari818 Год назад
15 mins into the video and I am impressed already. Crisp, highly valuable instructions. Enjoying it.
@murat6018
@murat6018 Год назад
Just brilliant as always!
@ovietennyson4267
@ovietennyson4267 4 года назад
I know over 8 stacks and node js wasn't a part of that list. Watching this video, it's safe to say I finally understand what node is about. Thanks, man, great video!
@arpee1337
@arpee1337 5 лет назад
34:45 I start sweating cold when a possible callback hell starts 😰
@limitless9483
@limitless9483 4 года назад
i can imagine Kyle Simpson telling me to use some library right there instead
@navneetmishra1309
@navneetmishra1309 4 года назад
Thank you sir! This helped me build my basics for node.js. Thank you!
@shivanigaddagimath5994
@shivanigaddagimath5994 3 года назад
Hey Navneet! have you built any projects using node? Are you a fresher and looking for opportunities in web development currently?
@Dowmiir
@Dowmiir 5 лет назад
Awesome guide as always Brad, many thanks :) Next stop: Your MERN udemy course :)
@gigajoules6636
@gigajoules6636 2 года назад
He says this isn't a whole project but it made a whole lot click and opened up a lot of potential for my future project architectures.
@ramziosta
@ramziosta 3 года назад
this channel is one of my top 5 to-go-to channels. Thank you!
@jacobuid
@jacobuid 5 лет назад
I am not getting the same intellisense shown in this demo, do I need a VSCode plugin?
@arnavvijayakar1414
@arnavvijayakar1414 4 года назад
Try installing Visual Studio IntelliCode. I know this is late but this might help others
@wakey_jakey
@wakey_jakey 4 года назад
@@arnavvijayakar1414 Thanks!
@MinneTechie
@MinneTechie Год назад
Thank you, Brad! This is an easy-to-understand tutorial. You seem to make the learning path straight which saves me from countless hours of potential confusion.
@nickcolavita8977
@nickcolavita8977 4 года назад
Another killer job breaking down something complex into understandable real world examples. Thank you.
Далее
Node.js Crash Course
2:06:35
Просмотров 183 тыс.
Самая сложная маска…
00:32
Просмотров 747 тыс.
Why aren't you using Fastify? Or Koa? Or NestJS?
9:58
The Importance of Specialization in Coding
7:13
Просмотров 231 тыс.
Will Deno 2.0 Replace Node.js?
12:35
Просмотров 49 тыс.
Every React Concept Explained in 12 Minutes
11:53
Просмотров 659 тыс.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Node.js is a serious thing now… (2023)
8:18
Просмотров 649 тыс.
Node.js Doesn’t Suck Anymore
16:59
Просмотров 111 тыс.
100+ Linux Things you Need to Know
12:23
Просмотров 1,1 млн
Learn Express JS In 35 Minutes
36:03
Просмотров 814 тыс.