Node.js Crash Course

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024
  • 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

Комментарии • 1,6 тыс.

  • @revillsimon
    @revillsimon 5 лет назад +1065

    “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 года назад +3

      Agreed

    • @phat80
      @phat80 3 года назад +4

      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 года назад +4

      True 100%

    • @suganganesan1999
      @suganganesan1999 3 года назад +3

      Just what I was feeling

    • @adrienconversanodbl_g5119
      @adrienconversanodbl_g5119 2 года назад +2

      Totally agree, I watched until the last minute

  • @pedrobatista7975
    @pedrobatista7975 4 года назад +257

    "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.

  • @ClevergunsYT
    @ClevergunsYT 5 лет назад +999

    I don't know how. My teacher teaches this for 3 months and u did it in an hour

    • @maskman4821
      @maskman4821 5 лет назад +107

      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 лет назад +70

      Hes paid to stretch it out over the 3 months, and cover a curriculum

    • @ClevergunsYT
      @ClevergunsYT 5 лет назад +31

      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 лет назад +8

      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 лет назад +9

      Yeah, it sucks how some teachers give you a lot of theory, while Brad goes to the point.

  • @andrewbrower4158
    @andrewbrower4158 3 года назад +38

    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!

  • @KiaanCastillo
    @KiaanCastillo 5 лет назад +237

    okay this is crazy. THE MINUTE I REALIZE I NEED TO LEARN NODE.JS ASAP AND YOU MAKE THIS VIDEO. THANK YOU BRAD!! 🙌🙏🔥

  • @nabil14409
    @nabil14409 4 года назад +161

    Using the quarantine time after this. Thank you, Brad. Stay safe.

    • @ianpaul0520
      @ianpaul0520 4 года назад +3

      yeah, there is no excuse now...

    • @kbcarte420
      @kbcarte420 4 года назад +1

      I bought a couple of his courses on Udemy while they're on sale too.

    • @RustyRustacean
      @RustyRustacean 4 года назад +2

      @@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.

  • @BekBrace
    @BekBrace 4 года назад +7

    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

  • @zenitzo
    @zenitzo Год назад +1

    4 years later and its still one of the best node js videos ive seen, thank you king

  • @jackiemcgough2997
    @jackiemcgough2997 Год назад +3

    I stayed too the end! You pushed the site to herouku. I just started programming and I'm a CS student at 32.

  • @MoatazSaber96
    @MoatazSaber96 3 года назад +2

    “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

  • @rongtoob
    @rongtoob 2 года назад +19

    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!😁

  • @wolvincraft9932
    @wolvincraft9932 2 года назад +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.

  • @TinyMaths
    @TinyMaths Год назад +4

    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 месяцев назад +1

      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.

  • @rock123458951
    @rock123458951 4 года назад +1

    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?

  • @B20C0
    @B20C0 3 года назад +4

    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.

  • @prakharmathur619
    @prakharmathur619 Год назад +2

    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!!

  • @punkgrl325
    @punkgrl325 3 года назад +4

    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!

  • @shivansh901
    @shivansh901 3 года назад +1

    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 RUclips 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.

  • @alexmerz4084
    @alexmerz4084 5 лет назад +7

    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!

  • @anthonywright4168
    @anthonywright4168 2 года назад +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!

  • @sadiqumar18
    @sadiqumar18 5 лет назад +277

    I need to like this before i start watching 🤗🤗

    • @UstadJi
      @UstadJi 5 лет назад +11

      I Always Like His Videos Before Watching ;)

    • @johnnydriesen7575
      @johnnydriesen7575 5 лет назад +1

      @@UstadJi So do I :)

    • @md.akib5124
      @md.akib5124 5 лет назад +1

      count me too

    • @phee3D
      @phee3D 5 лет назад +4

      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!

  • @BrendanMcNerney
    @BrendanMcNerney 2 года назад +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!

  • @himanshunahak5105
    @himanshunahak5105 4 года назад +3

    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!

  • @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!

  • @RyanSmith-qb6dl
    @RyanSmith-qb6dl 5 лет назад +6

    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 лет назад +2

    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 лет назад +1

      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!

  • @BalduinoFernando
    @BalduinoFernando 5 лет назад +29

    This year I gotta learn JS technologies... And This is the right place for me...

    • @lycan2494
      @lycan2494 4 года назад +6

      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

  • @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.

  • @JamieDawsonCodes
    @JamieDawsonCodes 3 года назад +8

    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';

  • @kenkioqqo
    @kenkioqqo 3 года назад +2

    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.

  • @ConorBailey
    @ConorBailey 5 лет назад +6

    Brad. Thank you so much for your work. I feel I have learned so much from your channel and courses. You're a legend.

  • @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...

  • @iali3903
    @iali3903 5 лет назад +58

    Brad always make me happy !

  • @ryanrahman26
    @ryanrahman26 2 года назад +2

    Thank you verry much... tutorial like this will never get olds....

  • @abhishek_k7
    @abhishek_k7 5 лет назад +44

    27:02 "can't talk while I spell concatenate" lol

  • @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.

  • @ssk7690
    @ssk7690 Год назад +5

    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!

  • @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!

  • @ChaosEmerald85
    @ChaosEmerald85 5 лет назад +8

    Thanks for all your hard work on these tutorials, Brad. You're awesome

  • @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!

  • @zuoqizhao2706
    @zuoqizhao2706 5 лет назад +5

    One of the best free tutorial videos I've ever seen! Thank you Brad !

  • @infinityApologeticsClips
    @infinityApologeticsClips 3 года назад +2

    I love this channel, thank you Brad.

  • @kunaljt
    @kunaljt 5 лет назад +4

    Just finished the react crash course yesterday, and was looking for one. Awesome timing, thanks!

  • @vibelover5444
    @vibelover5444 4 года назад

    This is just 1% of entire Node.js doc u have covered, still appreciate what you have given here, Thanks :)

  • @allex3842
    @allex3842 5 лет назад +4

    I was just looking through your old node js crash course and the notification for this came. Thanks for the great content

  • @tghhh19
    @tghhh19 2 года назад +1

    Thanks friend. Great video. I just started a web development bootcamp and this was assigned to us. Will definitely be watching your other vids.

  • @lektimsina2132
    @lektimsina2132 5 лет назад +30

    was waiting this one from you, Brad.
    We want more node.js tutorial videos.

  • @soni.himansh
    @soni.himansh 2 года назад +1

    Best NodeJs Video out there on RUclips, So simple yet so informative, love how calmly you teach. Appreciate it, Brad.Thanks.

  • @samuelemancuso9855
    @samuelemancuso9855 5 лет назад +4

    Time flew by, flawless tutorial. Thank you!

  • @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.

  • @flow7832
    @flow7832 5 лет назад +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.

  • @mishrajit
    @mishrajit 2 года назад +1

    I genuinely and really appreciate this crash course. To make me able to deploy my node web app on Internet on my first go.

  • @limitless9483
    @limitless9483 4 года назад +4

    i spent 2 days watching this video (4hours a day) man i appreciate everything that you do for us thanks again.

  • @aldrinmabanta
    @aldrinmabanta 4 года назад +1

    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!

  • @miles611
    @miles611 3 года назад +7

    Brad always delivering incredible content.
    Really appreciated, man!

  • @DeclanCrane
    @DeclanCrane 3 года назад +1

    Watching a video of yours is a breeze, and it's helping me achieve my dreams. So thank you! No need to thank me.

  • @emmythepixi
    @emmythepixi 4 года назад +5

    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!

  • @Couchwurst
    @Couchwurst 4 года назад +2

    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!

  • @FabricioEGiovanni
    @FabricioEGiovanni 5 лет назад +84

    Thank you very much for this flawless service to the dev community, Traversy.
    You are surely one of the best professors I ever had.

  • @chadpaulsen8751
    @chadpaulsen8751 3 года назад

    i'm a student and my instructor assigned this video for 3 assignments, great video and i'm a subscriber now!

  • @conaxliu9677
    @conaxliu9677 5 лет назад +23

    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.

  • @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.

  • @andrewartekha
    @andrewartekha 5 лет назад +9

    Thanks for knowledge that you're putting out.
    Can you please create a course about nest.js?
    Like it so Brad could see.

  • @skylar1112
    @skylar1112 4 года назад +2

    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.

  • @kadekeqw23
    @kadekeqw23 5 лет назад +5

    Great tutorial, as always Brad- thank you. This makes me realise how much easier life is with React.

  • @TheArtOfBe
    @TheArtOfBe Год назад

    All BS aside, this guy is the best online instructor I've come across for me. I know there's others but I seem to grasp more when listening to Brad. I appreciate you dude.

  • @chrisyates7060
    @chrisyates7060 5 лет назад +7

    Dunno about y'all but I DID the homework at 55:28. Star Student 😁

  • @abebe7017
    @abebe7017 3 года назад

    I stayed to the end! I thought you are skipping the Heroku stuff but you did finish it in just 5 mins

  • @crazycoder-gf8ls
    @crazycoder-gf8ls 5 лет назад +8

    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 лет назад +3

      I'm not Brad, but it really depends. Some projects are huge, some are simple static sites.

    • @Super_Cool_Guy
      @Super_Cool_Guy 5 лет назад +3

      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 лет назад +2

      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 лет назад +7

      @@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 лет назад +1

      Code lines/hour. How fast are u

  • @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?

  • @TechnoSparkBigData
    @TechnoSparkBigData 5 лет назад +6

    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...

  • @andrewstone3032
    @andrewstone3032 3 года назад +2

    21:35 import/export is now available in non-experimental version of ES6!
    *_How to Use import/export_*
    *in person.js*
    rename file to person.mjs (.mjs instead of .js)
    change: -module.exports = Person;-
    to: export {Person};
    *in index.js*
    change: -const Person = require('./person');-
    to: import {Person} from './person.mjs'
    Hope this helps!

  • @techbizlife
    @techbizlife 3 года назад +9

    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 ??

  • @ramziosta
    @ramziosta 3 года назад

    this channel is one of my top 5 to-go-to channels. Thank you!

  • @crustindanglade6036
    @crustindanglade6036 5 лет назад +7

    This tutorial was amazing, truly you are a lifesaver. On to your video on react!

  • @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!

  • @Binari
    @Binari 4 года назад

    I did not realize that the css files were served too, the web browser requested it behind the scene. Thanks again for this video!

  • @lardosian
    @lardosian 5 лет назад +4

    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 лет назад +12

      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 лет назад +3

      @@TraversyMedia Thanks Brad. 👍👍

  • @tt9378
    @tt9378 5 лет назад +1

    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.

  • @sidforreal
    @sidforreal 5 лет назад +7

    can you do a Tensor Flow udemy course...I am interested in that.

  • @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.

  • @lardosian
    @lardosian 5 лет назад +5

    when i write os.cpus i get back
    ' ZX Spectrum 128k, your cassette deck needs heads cleaned'.

  • @Gurpreetsful
    @Gurpreetsful 4 года назад

    Everytime I need to learn something new, I search it on youtube and silently wish for a video from you.

  • @Dowmiir
    @Dowmiir 5 лет назад +7

    Awesome guide as always Brad, many thanks :)
    Next stop: Your MERN udemy course :)

  • @Tripp111
    @Tripp111 2 года назад +1

    Brother, we appreciate YOU! Thank you!!!!

  • @mohammedansari818
    @mohammedansari818 Год назад

    15 mins into the video and I am impressed already. Crisp, highly valuable instructions. Enjoying it.

  • @thejavascriptshow3754
    @thejavascriptshow3754 5 лет назад +4

    Eyyy first, uve been such an inspiration for my videos, love u

  • @alanhamid5375
    @alanhamid5375 2 года назад +1

    Brad, you are simply the best tech instructor among all! Thank you from the bottom of my heart. 🙏

  • @Ahmed-helal98
    @Ahmed-helal98 5 лет назад +52

    React Native crash course 2019 please

    • @Shpongloid
      @Shpongloid 5 лет назад

      YES!

    • @maciejc3169
      @maciejc3169 5 лет назад

      Very good idea, because there have been made a lot of changes to React Native, so most of tutorials are out of date.

    • @sahilbagade
      @sahilbagade 5 лет назад

      Yes please!

    • @danielschmider5069
      @danielschmider5069 5 лет назад

      No thanks, react native is crap & the industry is a whole is shifting away from native apps

    • @osamagamal495
      @osamagamal495 4 года назад +2

      @@danielschmider5069 The industry is shifting away to it.

  • @ccppp6953
    @ccppp6953 3 года назад

    Bought your mern class and found your channel here. Thanks for sharing so much free high-quality contents!

  • @modern_sapien
    @modern_sapien 3 года назад

    Was here until the end.
    SO USEFUL to better understand why middleware exists and what some of it is definitely doing behind the scenes, also ENOENT.

  • @basil_b_vegan
    @basil_b_vegan Год назад +1

    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.

  • @tonnymwanzia9802
    @tonnymwanzia9802 2 года назад

    I have enjoyed this video. It's clear and simple for a beginner. No complications. Thank you very much

  • @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?

  • @jacobuid
    @jacobuid 5 лет назад +7

    I am not getting the same intellisense shown in this demo, do I need a VSCode plugin?

    • @arnavvijayakar1414
      @arnavvijayakar1414 4 года назад +1

      Try installing Visual Studio IntelliCode. I know this is late but this might help others

    • @wakey_jakey
      @wakey_jakey 4 года назад

      @@arnavvijayakar1414 Thanks!

  • @navneetmishra1309
    @navneetmishra1309 4 года назад +1

    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?

  • @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.

  • @algife
    @algife 2 года назад +1

    I'm recommending this kind of crash courses from you to other peers starting their journey! AMAZING job man! Thanks!

  • @allanrodrigues646
    @allanrodrigues646 Год назад

    Came here because of Leon Noel @100 Devs. Great content, let's go GET!!!!

  • @akashdohare8694
    @akashdohare8694 5 лет назад +8

    is this video enough for clearing the entry level interview ?

    • @potatolord7319
      @potatolord7319 4 года назад +3

      for anyone reading this. No you will need to practice what you have learnt first

    • @21agdmnm
      @21agdmnm 4 года назад +5

      potatolord 73 lol how did the interview go?