Node.js Crash Course Tutorial #6 - Express Apps

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • Hey gang, in this node.js tutorial we'll move on to another 3rd party package called Express. Express is a framework which helps us to easily create node.js web applications.
    0:00 -- what is express?
    2:28 -- creating an express app
    7:21 -- routing & html pages
    11:27 -- redirects & 404 pages
    🐱‍👤🐱‍👤 JOIN THE GANG -
    / @netninja
    ----------------------------------------
    🐱‍💻 🐱‍💻 My Udemy Courses:
    + Modern JavaScript - www.thenetninja.co.uk/udemy/m...
    + Vue JS & Firebase - www.thenetninja.co.uk/udemy/vu...
    + D3.js & Firebase - www.thenetninja.co.uk/udemy/d...
    🐱‍💻 🐱‍💻 Course Files:
    github.com/iamshaunjp/node-cr...
    🐱‍💻 🐱‍💻 Other Related Free Courses:
    + Modern JavaScript Tutorial - • Modern JavaScript Tuto...
    + HTML & CSS Crash Course - • HTML & CSS Crash Cours...
    🐱‍💻 🐱‍💻 Node.js links
    + Download here - nodejs.org/en/download/

ความคิดเห็น • 202

  • @tayfun6378
    @tayfun6378 4 ปีที่แล้ว +258

    I thought you should know this Shaun. I got a decent job for the first time as a developer in the middle of this covid period. your help meant a lot. thank you very much and I really appreciate all these amazing content. cheers mate!

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว +57

      Wow, awesome. Really happy for you & best of luck in your job! Keep on learning and push yourself to the top :)

    • @tayfun6378
      @tayfun6378 4 ปีที่แล้ว +4

      @@NetNinja will definitely do!

    • @ridl27
      @ridl27 4 ปีที่แล้ว +2

      @@tayfun6378 which developer are you ?

    • @tayfun6378
      @tayfun6378 4 ปีที่แล้ว +10

      @@ridl27 JavaScript backend

    • @davidbenson3170
      @davidbenson3170 4 ปีที่แล้ว +4

      That's awesome to hear!

  • @HimanshuShekharrocks
    @HimanshuShekharrocks 4 ปีที่แล้ว +68

    You are best teacher who knows how to teach beautifully.. keep it up sir..

  • @fearusinwar4580
    @fearusinwar4580 2 ปีที่แล้ว +66

    I want you to know that you are responsible for me receiving my first job when i started watching 3 years ago. I recommend you to everyone interested in getting into programming. Best tutorials on the net by far

    • @NetNinja
      @NetNinja  2 ปีที่แล้ว +18

      Thank you so much - really glad they helped you, well done on your job :)

    • @joshhaley91
      @joshhaley91 ปีที่แล้ว +1

      what job did you get?

    • @partingparrotprod.4936
      @partingparrotprod.4936 9 หลายเดือนก่อน

      @@joshhaley91 prolly

  • @lubomirpacheliev363
    @lubomirpacheliev363 3 ปีที่แล้ว +42

    My entire university is simping for you! Thank you for your hard work. You've helped me out a lot with those videos!

    • @NetNinja
      @NetNinja  3 ปีที่แล้ว +12

      Haha, thank you (& your university) for watching!!

  • @giorgi23
    @giorgi23 3 ปีที่แล้ว +5

    You have magic. It was always boring to watch youtube tutorials. I am watching and getting excited. Want to watch and learn more. Keep going dude

  • @andilesimelane4771
    @andilesimelane4771 4 ปีที่แล้ว +15

    Its just a matter of time, I update my CV, You are changing my life thank... you content is Awesome... I swear I will finish this series

  • @ashishkushwaha1167
    @ashishkushwaha1167 2 ปีที่แล้ว +2

    likes to dislike ratio says it all. Unmatched content. I am so glad I found you❤️. People who disliked, where do they come from?

  • @higherpurpose1212
    @higherpurpose1212 2 ปีที่แล้ว +6

    This tutorial is so much helpful to me, giving me the comparison of Node vs. Express in terms of routing/url. I don't want to go directly to Express without understanding how Node does it, and this video is exactly what I needed. What's also amazing about Shaun's tutorials is he clearly explains the underlying process behind a code completely and the answers to the WHYs, which other tutorials lack! Thanks Shaun!

  • @sohadmad1823
    @sohadmad1823 ปีที่แล้ว +3

    Whatever I say to you, thank you, it will not be enough. You are a miracle. Your way of explanation is really wonderful and interesting. Every day I sit for hours and watch your lessons.
    My heart just keeps thanking you and thanking you.
    You’re a blessing to me.
    Greetings to you from Palestine

  • @zam2890
    @zam2890 3 ปีที่แล้ว +7

    This video series has been great so far, amazing work!

  • @siddhanth3044
    @siddhanth3044 3 ปีที่แล้ว +2

    The best Node tutorial I've found. Brilliant stuff mate!

  • @Shakeel714
    @Shakeel714 3 ปีที่แล้ว +6

    Learning a lot from this tutorial series. Really appreciate your contribution to the web dev world.

  • @chameleonstreet5545
    @chameleonstreet5545 2 ปีที่แล้ว +1

    You are fully supplementing my learning while I'm in a coding camp. CRUCIAL! Massive help, thank u so much.

  • @nigelpallatt
    @nigelpallatt 2 ปีที่แล้ว +5

    Absolutely fantastic, where would we all be without your outstanding contribution to education. Thank you!

  • @jamesmassa1999
    @jamesmassa1999 2 ปีที่แล้ว

    Thank you for taking the time to produce this series Ninja... : ) The series has answered a few questions I had, great course informative, and well done.
    The course is a year old but is still absolutely relevant!

  • @BlueyMcPhluey
    @BlueyMcPhluey 4 ปีที่แล้ว +2

    I just discovered yesterday that if you don't want to manually set up routes for every address you can use
    app.use('/',express.static(__dirname,{extensions:['html']}))
    and it will automatically serve up all of the resources in that directory.
    Then after that you can use app.get() to make dynamic responses to specific requests
    And then after that you can use the 404 method shown in the video to respond to urls that are neither corresponding to files nor specifically indicated

  • @axyvox69
    @axyvox69 2 ปีที่แล้ว

    The most comprehensive crash course I've ever had! Thank you so much!

  • @himanshunahak5105
    @himanshunahak5105 3 ปีที่แล้ว +6

    I have watched countless tutorials and only this one is so intuitive and easy to understand for beginnners! You are a very helpful and a good quality teacher Shaun! Love from India!

  • @greenthumb7405
    @greenthumb7405 10 หลายเดือนก่อน +1

    im taking codecademy and Angela Yu's udemy course. This taught me Node better than everything else

  • @naywinhlaing7574
    @naywinhlaing7574 4 ปีที่แล้ว +2

    Happiness is watching your tutorials . Thank You so much !

  • @FiftyKcal
    @FiftyKcal 4 ปีที่แล้ว

    Excellent video on Express dude, hats off. Very clear and easy to understand, just perfect. Can't wait for more!

  • @bluemodize7718
    @bluemodize7718 2 ปีที่แล้ว

    man I gotta say this is one of the best tutorials I've ever seen, keep going mate

  • @jessieaguiao
    @jessieaguiao 4 ปีที่แล้ว +3

    thank you very much the net ninja. you helped a lot of people aspiring to be a good web dev. please keep on teaching.

  • @jeremymees
    @jeremymees 3 ปีที่แล้ว +2

    you have the best way of explaining things simpely, thank you for that

  • @shuttledeceptor1296
    @shuttledeceptor1296 24 วันที่ผ่านมา

    Absolutely Brilliant teaching style.

  • @AminulislamSakib
    @AminulislamSakib 3 ปีที่แล้ว

    If I search a topic on youtube, first look whether you made a video on that topic or not, if not then look for others.
    Thank you, sir, your videos are so much helpful to learn

  • @tanmaybhosale692
    @tanmaybhosale692 3 ปีที่แล้ว

    i watched ur earlier series helped me a lot ... n now this series is helping too gr8 work : )

  • @thebigbadwolf422
    @thebigbadwolf422 3 ปีที่แล้ว

    amazing teacher.. great series shaun. thank you very much for this course. you are saving peoples lives.

  • @billpapas3054
    @billpapas3054 2 ปีที่แล้ว +1

    U are more than a perfect teacher u are a God blessed human being!!!! Thx God u exist!!!!!!

  • @amaaniqbal9049
    @amaaniqbal9049 3 ปีที่แล้ว

    Hey Shaun !!! just wanted to thank you!! Amazing content!!

  • @kshitijagarwal3230
    @kshitijagarwal3230 3 ปีที่แล้ว +1

    Thanks a lot mate for the amazing work you are doing, really appreciate your efforts. Thanks a lot again!!

  • @alejandrojimenez3986
    @alejandrojimenez3986 3 ปีที่แล้ว

    Thank you for all your content, is so high quality and understandable.

  • @shahmeerkhan1565
    @shahmeerkhan1565 8 หลายเดือนก่อน

    You're a Legend mate, listening to this lecture at 4:45 am and still understanding everything you say precisely!

    • @NetNinja
      @NetNinja  8 หลายเดือนก่อน

  • @uness4511
    @uness4511 4 ปีที่แล้ว +2

    Now I am falling in love with express after watching this video.

  • @Amir-np4nb
    @Amir-np4nb ปีที่แล้ว

    Best course I've ever seen

  • @FxbyyMC
    @FxbyyMC 3 ปีที่แล้ว +1

    the best node tutorial thank you!

  • @thomaspynchon8400
    @thomaspynchon8400 3 ปีที่แล้ว

    I deadass took a 10$ Udemy course and it was unsurprisingly so bad compared to your TH-cam series. I wish I could have sent that money to you. Thanks a lot, mate! 🤩

  • @davem3953
    @davem3953 2 ปีที่แล้ว

    This series is awesome. Thank you. (Your accent/dialect reminds me of James Veitch.)

  • @TheSlyDragon93
    @TheSlyDragon93 4 ปีที่แล้ว +1

    Found a one command keyboard shortcut for copy and pasting on visual studio. After highlighting use "shift + alt + down" and it pastes below the code you highlighted.

  • @hvaceee
    @hvaceee 3 ปีที่แล้ว

    best node js teaching video, thanks a lot!

  • @quoctrungtran6403
    @quoctrungtran6403 2 ปีที่แล้ว

    Thank you for your wonderful lessons!

  • @huffypuff0
    @huffypuff0 11 หลายเดือนก่อน

    Amazing video!! Thank you so much for this series!

    • @NetNinja
      @NetNinja  11 หลายเดือนก่อน +1

      You're very welcome - hope it helped!

  • @Tokur-zi7xf
    @Tokur-zi7xf 3 ปีที่แล้ว

    I struggled with this , not sure if it was the instructors fault or the fact that they were using older node versions compared to mine(could also been a powershell issue on my part). But I will say your teaching is very good and it really sunk in this time.

  • @chadgregory9037
    @chadgregory9037 ปีที่แล้ว

    I am loving express!!!

  • @danielbar1837
    @danielbar1837 3 ปีที่แล้ว

    Which extend u have for the little files icon?
    And ty so much for the vids mate!!

  • @elkhanhamet2561
    @elkhanhamet2561 3 ปีที่แล้ว +1

    Mate, how are you! I hope you're safe and ok with all this madness going on around us with the virus and all. I just wanted to thank you for, honestly, the best videos on TH-cam that makes a hardest topic in any language a walk in the park. God Bless mate, stay safe and take care of yourself.🙂👍👍👍

  • @dannyman2200
    @dannyman2200 3 ปีที่แล้ว

    Another great video and playlist! Hey youtube team I'm probably being a little impatient, I have looked but can't find an answer. How does express and React work together? specifically the file structure would this express example be installed on the React app.js file with all the requests listed or are they kept completely separate? or something else, I can't picture the flow basically

  • @ionutcatalingheorghiu8953
    @ionutcatalingheorghiu8953 4 ปีที่แล้ว +1

    cmn, cmn.... next video please!!! Thanks for sharing!(also.. i miss the Bruce Lee sound when the video starts .it always made me smile! whoooooaaaa!)

  • @scholtzgnomie
    @scholtzgnomie 3 ปีที่แล้ว

    Hey Shaun. Loving this Node course! :) Would you consider making a Modern JS Udemy course for the back-end, like your did your Modern JS course for the front-end? I would get it in a heartbeat!

  • @yinonb172
    @yinonb172 3 ปีที่แล้ว

    best node.js tutorial ever

  • @VideoBunt
    @VideoBunt 4 ปีที่แล้ว +3

    I didn't know that use() could used like default in switch statement, interesting thought

  • @official.mhm13
    @official.mhm13 4 ปีที่แล้ว +2

    Thank You Shaun 😊

  • @harjithramesh217
    @harjithramesh217 2 ปีที่แล้ว

    Great Tutorial!

  • @creepermanpro
    @creepermanpro 3 ปีที่แล้ว

    even being spanish speaker, you are very understandable, thanks for your knowledge

  • @mikedelta658
    @mikedelta658 ปีที่แล้ว

    Fantastic explanation. Thank you!

    • @NetNinja
      @NetNinja  ปีที่แล้ว +1

      You're very welcome! Hope it was helpful :)

  • @cedric_ds
    @cedric_ds 4 ปีที่แล้ว

    Hey Ninja :) will you once make a playlist on how to create browser extensions?

  • @dangvu2447
    @dangvu2447 3 ปีที่แล้ว

    thank you...best tutorials ever :)))

  • @TheALCONT
    @TheALCONT 2 ปีที่แล้ว

    Thank you for the amazing content 😍😍

  • @user-pi1ff8jy8y
    @user-pi1ff8jy8y ปีที่แล้ว

    thanks for such an amazing series.

    • @NetNinja
      @NetNinja  ปีที่แล้ว +2

      Thanks Piyush!

    • @user-pi1ff8jy8y
      @user-pi1ff8jy8y ปีที่แล้ว

      @@NetNinja OMG! cant believe you replied. thank you for creating all the lectures. I actually got a job by learning from you and i am still learning a lot everyday from your lectures. Thanks for creating such short and precise lectures.

  • @Tanner_Goodale
    @Tanner_Goodale 4 ปีที่แล้ว

    Just what I needed

  • @caglayagmurr
    @caglayagmurr 11 หลายเดือนก่อน

    this is golddd 🎉

  • @yaldakarimi3772
    @yaldakarimi3772 3 ปีที่แล้ว

    thank you so much for creating this great content

  • @Slikon
    @Slikon 4 ปีที่แล้ว +1

    Videos every day! Thanks!
    I have just started your old node.js course, because it is complete at the moment. Should I watch this course after finishing the old one? Will I miss something if I would not watch the new course?

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว +2

      Hey, the new course is just more up-to-date and a bit more polished. I cover a little more about MVC & use Mongo Atlas instead of mLab in this course too. But most of the core concepts will be similar :)

    • @Slikon
      @Slikon 4 ปีที่แล้ว

      @@NetNinja Okay, thanks! I will watch both not to lose anything :D

  • @kaebogtimater
    @kaebogtimater 2 ปีที่แล้ว

    great content, sir

  • @gimmickgamer5684
    @gimmickgamer5684 4 ปีที่แล้ว

    Can you tell us your vscode themes? It's just so beautiful.

  • @Samuel-ns5jb
    @Samuel-ns5jb 11 หลายเดือนก่อน

    Why are you soo good ? 😂❤. Excellent teaching.

    • @NetNinja
      @NetNinja  11 หลายเดือนก่อน

      Haha, thank you! 😃

  • @robinware77
    @robinware77 3 ปีที่แล้ว

    for anyone having issues using npm install on an ubuntu linux system remember to put sudo first. sudo npm install express or any package. At lease that is what Pop Os requires of me.

  • @limitless003
    @limitless003 10 หลายเดือนก่อน

    You are the best !

  • @pankajjoshi8292
    @pankajjoshi8292 2 ปีที่แล้ว

    how does { root : __dirname} takes us to root folder? or is it like everytime we want to go to root we have to mention {root: __dirname} or is it like it returns parent directory ?

  • @razelahmed16
    @razelahmed16 4 ปีที่แล้ว +1

    Tnx infinity Legend ❤️🤘😊

  • @dennisgonzales9521
    @dennisgonzales9521 4 ปีที่แล้ว

    Awesome video

  • @shashankm.g.3757
    @shashankm.g.3757 3 ปีที่แล้ว

    AMAZING!!!!

  • @vinjamuripawansudhir8170
    @vinjamuripawansudhir8170 4 ปีที่แล้ว

    hey is redux a good option for large mern stack apps when compared to context and hooks???
    or context + hooks are better ??

    • @wiiktor1393
      @wiiktor1393 3 ปีที่แล้ว

      In my opinion - hooks + redux are great solutions, if you want to build an app in MERN stack.

  • @MaryMcGowan-kj1gb
    @MaryMcGowan-kj1gb 2 หลายเดือนก่อน

    Hi Shaun, thanks again for your amazing videos. I was just wondering, if you or anyone could help me with a question - at 6:20mins you use the command "nodemon app" to start the server. My laptop won't allow that and instead generates the error message "zsh: command not found: nodemon". However I worked out that I can get it up and running with the command "npx nodemon app" instead. I've tried to find out why is this different / is command discouraged? Many thanks for any insight anyone might share.

    • @titus9277
      @titus9277 หลายเดือนก่อน

      Just try re-installing nodemon globally.

  • @whoIsV
    @whoIsV ปีที่แล้ว

    How to route to a react app's root index.html? I tried to create a client folder, installed react in it then linked the "/" root URL of express to react's index.html but it didn't work. It showed a blank white page.

  • @user-mn3iq2cs9n
    @user-mn3iq2cs9n 3 ปีที่แล้ว +4

    @6:43 res.send('home page') gives me a green light, but a status of 304 not modified. Can anyone explain? Thanks!

    • @rajapriyadharshinims245
      @rajapriyadharshinims245 3 ปีที่แล้ว +9

      same situation here...express by default adds a weak etag header...our resources are cached by our browser...when u start ur server for the first time, you'll get a status code of 200...coz there is no resource being cached....but if you request for the same resource again, our browser has a copy of that resource...thats y status code becomes 304...
      we can disable this too...to do that..
      app.disable('etag')
      This should work..!!!

    • @illiaillia283
      @illiaillia283 2 ปีที่แล้ว

      @@rajapriyadharshinims245 Thank you

  • @ABMA79
    @ABMA79 2 ปีที่แล้ว

    I do have a question though.
    Even though you are setting HTML files, I was wondering why the CSS file is not been executed in the calling. it is specified in each HTML file head, how come when the page appears, the stylesheet file is not executed as well !!!!!
    at least, it is not working with me.
    I am honestly loving your tutorial to the max brother.
    Keep up the good work.
    you are amazing.

  • @saida584
    @saida584 4 ปีที่แล้ว

    express ---- elegant

  • @mrs7lya
    @mrs7lya 4 ปีที่แล้ว +2

    Hello brother, thank you for this great content, I didnt see the course yet but I have question, can we use node js as a backend for our flutter app ? Because I am learning flutter right now and want to use both of them in my projects
    Thank you

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว +4

      Hey, yeah you can use node to run an api which flutter can communicate with.

  • @Shad1991
    @Shad1991 4 ปีที่แล้ว

    Brilliant

  • @alexg7282
    @alexg7282 2 ปีที่แล้ว

    Thx!

  • @goodbuddyenglish8058
    @goodbuddyenglish8058 3 ปีที่แล้ว

    Hi there, When I wrote "nodemon app" on the terminal I got this warning: "running scripts is disabled on this system." Could anyone explain to me what might be the reason. Thank you

  • @mohammedabdulbary1577
    @mohammedabdulbary1577 4 ปีที่แล้ว +1

    You are awesome ❤️

    • @NetNinja
      @NetNinja  4 ปีที่แล้ว +1

      Thank you :)

  • @christianmottaz7366
    @christianmottaz7366 7 หลายเดือนก่อน

    Hello Ninja 😊
    It seem like express is not anymore maintained so I was wondering if there is a better alternative…
    Anyway thanks lot for all what you do for the community.

  • @mohamedshamoon4827
    @mohamedshamoon4827 2 ปีที่แล้ว

    What is the best practice? import express from "express"; or const express = require("express");

  • @adeoyeadedamola6728
    @adeoyeadedamola6728 2 ปีที่แล้ว

    You’re the best
    You seem to be well grounded on how to educate starters. I’m giving you a shoutout on my Twitter page so others can find your page

  • @ritikgupta1133
    @ritikgupta1133 2 ปีที่แล้ว

    well i love your voice ❤

  • @angelosorte5464
    @angelosorte5464 2 ปีที่แล้ว

    Hi. If I install a package from the terminal in VScode, will it be installed locally to the project, while installing it through the terminal of our operating system it will be installed globally? (thanks!)

    • @DebjitMajumdar
      @DebjitMajumdar ปีที่แล้ว

      Suppose you install
      npm install express
      ^ Local tied to that project folder
      npm install -D express
      ^ Local to folder but as a Developer Dependency
      npm install -g express
      Installs globally
      Got it?

    • @DebjitMajumdar
      @DebjitMajumdar ปีที่แล้ว

      The terminal in Vscode and the standalone terminal outside are the same thing no difference.

  • @Adam-bq2us
    @Adam-bq2us 4 ปีที่แล้ว +1

    As a beginner in Node is it more beneficial to start using pure Node in projects so as to understand how it works before adding the Express framework, or does it not make much of a difference?

  • @technologyexplained
    @technologyexplained ปีที่แล้ว

    Thank you for this wonderful tutorial. I was just wondering: why don't we end response when we use res.send()? if we are using res.write() shaun is using res.end(). Just curious. Do let me know the answer.

    • @evanilsonp.8183
      @evanilsonp.8183 ปีที่แล้ว +1

      Because, let's say, It is already understood by express under the hoods. res.send() works to send the content and to end the content at the same time. That's why express is so popular 'cause it gives us more features to work with and make our lives easier.

    • @technologyexplained
      @technologyexplained ปีที่แล้ว +1

      @@evanilsonp.8183 Understood. Thank you.

  • @jijobuje
    @jijobuje ปีที่แล้ว

    10:20 Can someone explain the line 11? I didn't understand the js syntax. Where did we declare the "root", why is there a ":" , what does it mean when we use curly brackets in the parameter of a function?

    • @DebjitMajumdar
      @DebjitMajumdar ปีที่แล้ว

      It is an Object. You can pass Objects into Functions as arguments whenever you are calling it.
      Here he is specifically passing the "root" property with the value "_dirname" enclosed in an Object as the 2nd argument to the method(function) sendFile.
      Gotcha?

  • @diegoavendanohernandez9908
    @diegoavendanohernandez9908 19 วันที่ผ่านมา

    you're awesome

  • @tarekghosn3648
    @tarekghosn3648 ปีที่แล้ว

    ooooh weeeee express here we come

  • @jithinp8441
    @jithinp8441 3 ปีที่แล้ว

    I can't link pages through the simple html tag it gets cannot GET /views/index.ejs or any other pages related to the ejs

    • @saidalizade1291
      @saidalizade1291 3 ปีที่แล้ว

      the file ending should be .js not ejs i think

    • @jithinp8441
      @jithinp8441 3 ปีที่แล้ว

      @@saidalizade1291 but in this netninja do the same:(

  • @karoliskaz9245
    @karoliskaz9245 3 ปีที่แล้ว

    Thanks

  • @Ksenseisei
    @Ksenseisei 3 ปีที่แล้ว +1

    after creating the app file my page still uses the server.js content even though I run
    nodemon app
    it writes
    [nodemon] restarting due to changes...
    [nodemon] starting `node app server.js`

    • @parv69
      @parv69 10 หลายเดือนก่อน

      did u find any sol, i m facing same error

  • @doniaelfouly4142
    @doniaelfouly4142 ปีที่แล้ว

    thanks

  • @ketan2662
    @ketan2662 4 ปีที่แล้ว

    You teach great.
    Sir sails.js tutorial after this please.

  • @ericpodhorecki5427
    @ericpodhorecki5427 3 ปีที่แล้ว

    great

  • @jppontverges
    @jppontverges 3 ปีที่แล้ว

    why you didnt use the .end() method everytime you send a file