Node.js Crash Course Tutorial #8 - Middleware

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 237

  • @lukemuga434
    @lukemuga434 4 года назад +55

    Net Ninja's style of teaching is absolutely the best. He applies the Feynman Technique in all his videos enabling someone to grasp even the most complex concepts without having to bang your head.

  • @DECKsek
    @DECKsek 4 года назад +52

    When a new Net Ninja video goes up:
    1. open video
    2. smash the like button
    3. start watching :)
    By far my favorite youtube channel for learning new things

    • @lucasfelipe-ze5sy
      @lucasfelipe-ze5sy 4 года назад +5

      0.1 - disable adblock

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

      Except for the "view engine" video, it's what I automatically do for each video, because I already trust his contents.

  • @leonelgauna1174
    @leonelgauna1174 4 года назад +101

    For anyone out there having problems with the styles not loading for the "/about/create" path, make sure you link your css to the html file as "/styles.css" and not "styles.css", otherwise it doesn't work. When you automatically create a link tag with VSCode by typing "link:css", VSCode doesn't add the slash at the beginning, so you might miss that.

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

      thanks.

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

      Thank you, I've been scratching my head for the past half an hour

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

      Hi! Do I need to install Nodemon, Ejs, and other third party packages every time I start a project?

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

      @@ahmedlabeeb2969 It depends on the project. I don't know what you want to build. Depending on the ideas you have, your project might need many third party packages, or none.
      Nodemon is good to have because it keeps track of the changes you make to your code and automatically restarts the server, that way you don't have to be constantly shutting down and turning on the server every time you change a line of code. Does a project need it to work? No, but it sure is helpful.
      EJS is a view engine that allows you to do server-side rendering. Basically you build your html on the server and then send it to the client's browser. It also gives you many features to build your pages. You can check its documentation to learn more.
      Again, the only one who knows what packages your project needs, it's you :).

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

      @@leonelgauna1174 Thanks!

  • @samdimahmood9047
    @samdimahmood9047 4 года назад +159

    YOU ARE EPIC!! You have literally taught all the topics that aren't explained in depth anywhere in youtube . I have followed this series from video 1 and each were equally informative and well explained. :D

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

      I know Im quite off topic but do anybody know of a good website to watch newly released series online ?

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

      @Cayson Emilio Thank you, I signed up and it seems to work =) Appreciate it !!

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

      @Shane Orion Happy to help :D

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

      forget youtube even some of the best universities wouldn't teach you this good. Thank you from the bottom of my heart man you teach really good.

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

      He has explained beautifully why this thing has arrived, why we will be using it, What we can do next to encounter this code?? Great thanks to him making such informative video. @NetNinja

  • @cagnusmarlsen4050
    @cagnusmarlsen4050 2 года назад +11

    This is the best node tutorial on youtube.

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

      Thanks for watching Cagnus!

  • @codedynamics1
    @codedynamics1 4 года назад +12

    Let's address THAT issue "NEXT" and then moved onto explaining .next() function 👏😂 im starting to like this guy 😂💯

  • @brianmlambo3306
    @brianmlambo3306 4 года назад +15

    I wanted to watch the series at the end but I have run out of patience , am gonna refresh myself with this. Your videos are absolutely gold especially for beginners and intermediate developers.

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

      Should all be up in about 3 days anyway :). Enjoy!

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

      @@NetNinja Hi! Great Video. Do I need to install Nodemon, Ejs, and other third party packages every time I start a project?

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

      @@ahmedlabeeb2969 If You Have Installed these packages globally like --g then you don't have to install them again and again
      But if you don't have done them globally you have to setup your npm and Install them in the Project
      Although it is your wish what you wanna do

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

      @@vinayak5788 Thanks

  • @amymarais4909
    @amymarais4909 3 года назад +10

    thank you so much for adding diagrams when explaining concepts! it really brings everything into perspective and I haven't seen anyone use them for explanation purposes so BIG UPS TO YOU!!!

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

    Серед усіх відео англомовний курс виявився для мене найбільш зрозумілим та цікавим. Thanks a lot!

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

    Shaun, you're one of the best teachers I've come across.
    Words aren't just enough to express how grateful I am for coming across your channel.
    You're an amazing teacher and you'll definitely go very far.

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

    Honestly understood the middle ware concept clearly than before thank u Shaun!!

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

    The Net Ninja > Very very quality content , Very very good teaching methods.

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

    I've watched a lot of tutorials demostarating how to use nodejs and express to create website, but only you explained every theory behind so detailed. Thumb up! Thank you so much!

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

    Anyone else absolutely loving the way he says R?

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

      Aha, thank you :) loving your username!

  • @Daniel-nb3kk
    @Daniel-nb3kk 4 года назад +1

    This channel is one of the best free learning resources you could find on the internet!

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

    This was something I wanted to learn ever since I started web development. Thank you, Net Ninja for helping me black belt in it.

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

    The way you explained next() function was just awesome keep up the good work

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

    Now i can say "What middle ware is".. You r an amazing teacher Shaun!

  • @mustafa842
    @mustafa842 3 месяца назад

    Best Teacher ever no one can explain it more better thats why i am watching it in 2024

    • @NetNinja
      @NetNinja  3 месяца назад

      That means a lot :) thanks for watching!

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

    Dude, in one of the PHP videos, you were using code that was outdated. Please check the documentation before writing some new code for your videos. Anyway, you are an AWESOME teacher, and you are the only person on RUclips that I have found that is so helpful and organized for coding.

  • @ideshmaaerdene-ochir4247
    @ideshmaaerdene-ochir4247 4 года назад +4

    Your teaching method is great and every lesson is interesting from the beginning till the end. Thank you. Good luck!

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

      Thank you! 😃

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

    Your explanation of middleware is the best I have come across mate !!

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

    I dont comment often, but i want to let you know you help me a lot! Thanks Man, you are my preferred Web development Teacher, crystal clear explanation! Respect!

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

    You're the one I'd give a thumb up without watching the video. I know for sure it will be amazing content. Thank you, you're great 👏

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

    I am blown away with your skill to simplify things. Thanks for your lessons and I look forward to one day paying for premium content. 👌🏼

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

    Petition for youtube to add a double like button. This is so good I almost cried.

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

    Pretty often, for a French guy like me, we can be pretty afraid of programming jargon.
    When we speak about some terms like "Middleware", we think about something very technical, until someone explain that it's a simple/useful concept to apply.
    In any case, thank you for all the stuff you vulgarize.
    About view engine and static file (for CSS), I was already looking for clues/solutions by myself, so I didn't really need this new information.
    Even if I was pretty rough in my last comment, it was because I preferred something cleaner (Liquid) for my view engine than what you proposed.

  • @tylerdurden9411
    @tylerdurden9411 Месяц назад +1

    U R awesome, thank you, Im learning more from here that from my school, thank you thank you thank you!!!

    • @NetNinja
      @NetNinja  Месяц назад +1

      You are so welcome! :) thanks for watching

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

    best node.js tutorial ever

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

    The best teacher ever, nice and clear explanation.

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

    Only up to lesson 8. This course has really been explained well. TY Net Ninja.

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

    Thank you for your video. I started learning programming node.js last and your video was the missing link to understand the difference of middlwares and callback functions ... etc . indeed i very excited to follow all your lessons . thanks again

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

    we just need another video about how to deploy the website. and thank you so much you are a great guy

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

    Thanks Shaun for the wonderful tutorial series

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

    Not just the Ninja's blade must be sharp, the technology which he uses also must be cutting edge!

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

    i try to understand middleware by taking many videos but it not works. but now i understand after watching your video lec. thanks you are super

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

    This was a very well done tutorial. Thanks!

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

      Hi! Do I need to install Nodemon, Ejs, and other third party packages every time I start a project?

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

    Thanks NetNinja Best Crash Course for NodeJS.

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

    Net Ninja is on Fire 🔥 Thnx man

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

      Hi! Do I need to install Nodemon, Ejs, and other third party packages every time I start a project?

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

      @@ahmedlabeeb2969Yes but if you don't want than you can install packages globally so that all the node. js application on your computer can import and use the installed packages

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

      @@pratikxavier8176 Thanks man!

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

    Great one Thanks. One question please. is the Static middle ware needs to be on top before the Routes? Cheers

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

    I am from Bangladesh . Your video is very helpful to me.

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

      I didnt know u guys have internet

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

      @@Ath9394
      it's your ignorance

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

    Brilliant, just brilliant. So well thought out.

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

    that "alright then gang" ? is pretty damn stylish as much as your explanation, thank u so much

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

    Amazing tutorials mate! Big THUMBS UP!

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

    This is phenomenal content, man. Keep up the good work!

  • @AD-lr6pc
    @AD-lr6pc 3 года назад

    Very well explained, like : dislike ratio tells your everything about this video

  • @thunder-brawlstars3020
    @thunder-brawlstars3020 5 месяцев назад +1

    After watching many tutorials on node i didn't understand, but now i have understood every single concept here , thx for series.

    • @NetNinja
      @NetNinja  5 месяцев назад +1

      Awesome! :) thanks for watching

  • @1dshabeer
    @1dshabeer 3 года назад

    You are the best man, keep going.!

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

    Brilliant as always Shawn...

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

    Watched all the ads, thanks for the awesome videos!

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

    Great Lesson, liked it.

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

    You explained the concept very well and its simple to understand thank you very much

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

    why didn't you use next() command in express.static() middleware?

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

    Net Ninja my man😍🔥 love your videos 💯

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

    This is what I call middleware made easy.
    Thanks theNetNinja,.
    I'm curious, what are you planning for the long awaited new course plus updates on vuejs course 🤦🏽‍♂️🤦🏽‍♂️🤦🏽‍♂️

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

      Hi! Do I need to install Nodemon, Ejs, and other third party packages every time I start a project?

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

      Ahmed Labeeb, nodemon can be installed once globally but other packages needs to be installed per project
      Happy coding :)

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

      @@raymondmichael4987 Thanks man!

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

    love your channel man!!

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

    Excellent tutorials no doubt. Thanks NINJA. I have a question. To let express know about my static files I used the 'public' folder [ app.use(express.static('/public'))] but this did not work until I changed to [app.use(express.static(__dirname + "/public"));] . Is there a difference? I thought it's the same thing!

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

      Hey, the path is relative to your app.js file where you launch your node process. So if your public directory is in a different location to your app.js file, then you will need to build the absolute path using __dirname. Otherwise, you can just use use 'public' (no need to use '/' before it either). Hope this helps.

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

      ...tnx 🙏🏾

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

      @@NetNinja I spent a lot of time in this, thanks for answering those question

  • @ojingwachidiebere8487
    @ojingwachidiebere8487 11 месяцев назад

    Bro you are so good in teaching

    • @NetNinja
      @NetNinja  11 месяцев назад

      Thank you so much 😀

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

    I like your tutorial and give thumbs up on every one. But I just want to give feedback on one thing that I think about. Every time you paste code and say it is so we don't have to be bored watching you type it out I think to my self, "well i would actually like to watch you type it out".
    So far I can just pause the video and type it out, but there is value in typing ALL code with you and hear the discussion about it.

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

    Thanks for all your lectures😇😇😇

  • @JagTheRipper
    @JagTheRipper 9 месяцев назад

    Hi I am currently stuck in my project. I want to server static css, img, js files to the client on the browser, I followed your steps exactly but keep on getting this error:
    mime type is not executable

  • @cafe-tomate
    @cafe-tomate 3 года назад

    How did they use to do when express didn't exist and they wanted to include static files ?

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

    Isn't using React states + React router basically doing the same thing as node/express, if i'm not designing a website that needs to store data ?

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

    great tutorial, I am learning a lot from it! everything was going good until now I got a problem installing morgan, a nertwork problem, any solution for that? do I need morgan to keep it going?

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

      Try npm install morgan --force

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

      @@TheJojoboy12 Thank you for your suggestion, I ended up finding out that it is a 'cache' problem and I need to clear cache and restart VScode to be able to install anything again, it happens every so often

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

    Really appreciate , but I've a question
    [app.use(express.static('public'));] doesn't work with the long url (/blogs/create) i changed it to (/create) and it worked
    Can any one help plz..!
    and THANKS

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

    Hi Shaun, Why we didn't use next() function in the 404 route where we also used app.use? Doesn't express hang there? Can you please clarify? Thanks

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

    Can you do F# after this series
    pls
    your channel is the best coding channel on yt

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

    Best instructor

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

      I got a job as a react developer and your course helped me the most. Now i am promoted to full stack and your node course is again helping me. So glad to have a instructor like you. And you coding style is so neat. Just love it.

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

    What are the typical types of files we that we should keep in the public folder?

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

      Awesome tutorial btw! Helps alot for beginners like me 👍🏽👍🏽👍🏽

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

      Thank you Net Ninja

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

    Very very appreciated, thanks.

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

    thank u bro, you have talent of explaining simply

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

      You're most welcome :) thanks for the kind words!

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

    Can you re-upload reactjs. Since the earlier is too old. It's completely changed now.

  • @cafe-tomate
    @cafe-tomate 3 года назад

    Hi Shawn,
    Can we do the same thing (calling next() ) in non-express server ? Like the ones of the first videos

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

    Can we use express.static() without app.use() . i mean it's still running as a middlewear ??

  • @cafe-tomate
    @cafe-tomate 3 года назад

    The res[content-length] argument of morgan is supposed to be the length in bytes of the file's body. Why does it shows --- in the screen of the tutorial?

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

    You are just amazing. Thank you. Well explained

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

    thanks

  • @Ash-fh3mh
    @Ash-fh3mh 4 года назад +12

    Hi! I was just curious if you sell any net ninja merch? I would love to get a t-shirt or a sticker. :)

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

      Hey, yeah - there should be some merch displayed beneath my videos!

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

      @@NetNinja in some countries this isn't available. i was interested in merch for a long time, but the option you are describing isn't available in poland. could you please put a link in the description for that?

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

    How can i download Course file? because there isn't code in github.

  • @leonmarienga3293
    @leonmarienga3293 Месяц назад

    Thank you, solid as always

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

    hello ninja teacher! you helped me alot !!

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

    Awesome video, mate!

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

    Great explanation.

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

    Hey Net-Ninja San,
    Can you recommend on cookies/sessions middleware ?
    10x

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

    Great crash course :)

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

    im looking forward to auth :)

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

    why u cant use next() in the 404 block?

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

    When you define logger middleware you say after executing that code it does not know how to proceed further and then next() comes in but at beginning of video you say it runs from top to bottom so why it doesn't run from top to bottom after executing logger middleware without next function at #5:40

  • @HasinthaWeragala
    @HasinthaWeragala 9 месяцев назад

    good stuff mate

  • @martinp.617
    @martinp.617 4 года назад +1

    Salamat..,

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

    Hi Net Ninja!!!! You are awesome bro. I have learned more from your free youtube tutorial more than other peoples' paid premium courses. Thanks!!!!
    I have are quest. Can you please make small project tutorials on user sign up, submit query forms and etc? Please.
    Thanks again!!!!

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

    Thank you unmeasurably! what program do you use for your slides ?

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

      Hey, I mainly use Adobe XD.

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

      @@NetNinja thanks 😁 your representations are very helpful in understanding the concept. Keep on using visuals 😬

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

    can u share some videos about nodejs with mongodb
    and a lot of thanks for ur hard work ♥

  • @official.mhm13
    @official.mhm13 4 года назад

    Well Explained

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

    Best tutorial.....

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

    @5:37 i see what you did there hahahaha !

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

    Which icon pack you use?
    I am looking for a decent icon pack for my VS Code and yours look nice.

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

      I'm pretty sure that's Material Icons extension

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

      Hey its Seti-icons :)

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

      @@NetNinja Dude, I'm confused, I'm using Matherial Icon Theme and icons look same as on your videos...

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

      @@NetNinja thanks! ^_^

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

    How come you don't need to include next() in thirdparty middlewares? 11:19

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

    amazing my friend

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

    Why won't the favicon load this way?

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

      I can load anything in the fold with app.use(express.static('folder_name'); but not favicon at all. Doesn't even 404. No load no error just will not load a favicon at all. Any thoughts?