Node.js Crash Course Tutorial #6 - Express Apps
Vložit
- čas přidán 24. 07. 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/
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!
Wow, awesome. Really happy for you & best of luck in your job! Keep on learning and push yourself to the top :)
@@NetNinja will definitely do!
@@tayfun6378 which developer are you ?
@@ridl27 JavaScript backend
That's awesome to hear!
My entire university is simping for you! Thank you for your hard work. You've helped me out a lot with those videos!
Haha, thank you (& your university) for watching!!
You are best teacher who knows how to teach beautifully.. keep it up sir..
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
Thank you so much - really glad they helped you, well done on your job :)
what job did you get?
@@joshhaley91 prolly
I really like Net Ninja because he actually explains the deeper level rather than just showing you the way we do it normally. For example, he goes into how Node.js by itself is used to manage server operations such as requests and responses, but then later on he shows you the more convenient way to do it on the regular basis (express). This is highly admirable especially coming from an autistic person who has a very deliberative thought process, I always seek to understand everything I do and why it works from a bottom-up perspective. That's why I am very slow at learning math haha.
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!
This video series has been great so far, amazing work!
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
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
Absolutely fantastic, where would we all be without your outstanding contribution to education. Thank you!
You are fully supplementing my learning while I'm in a coding camp. CRUCIAL! Massive help, thank u so much.
The best Node tutorial I've found. Brilliant stuff mate!
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!
Learning a lot from this tutorial series. Really appreciate your contribution to the web dev world.
The most comprehensive crash course I've ever had! Thank you so much!
thank you very much the net ninja. you helped a lot of people aspiring to be a good web dev. please keep on teaching.
Excellent video on Express dude, hats off. Very clear and easy to understand, just perfect. Can't wait for more!
Happiness is watching your tutorials . Thank You so much !
man I gotta say this is one of the best tutorials I've ever seen, keep going mate
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
you have the best way of explaining things simpely, thank you for that
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!
i watched ur earlier series helped me a lot ... n now this series is helping too gr8 work : )
amazing teacher.. great series shaun. thank you very much for this course. you are saving peoples lives.
Hey Shaun !!! just wanted to thank you!! Amazing content!!
Thanks a lot mate for the amazing work you are doing, really appreciate your efforts. Thanks a lot again!!
Thank you for all your content, is so high quality and understandable.
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
Absolutely Brilliant teaching style.
the best node tutorial thank you!
likes to dislike ratio says it all. Unmatched content. I am so glad I found you❤️. People who disliked, where do they come from?
U are more than a perfect teacher u are a God blessed human being!!!! Thx God u exist!!!!!!
Best course I've ever seen
Now I am falling in love with express after watching this video.
best node js teaching video, thanks a lot!
Thank you for your wonderful lessons!
I am loving express!!!
Amazing video!! Thank you so much for this series!
You're very welcome - hope it helped!
You're a Legend mate, listening to this lecture at 4:45 am and still understanding everything you say precisely!
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
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 CZcams that makes a hardest topic in any language a walk in the park. God Bless mate, stay safe and take care of yourself.🙂👍👍👍
this is golddd 🎉
I deadass took a 10$ Udemy course and it was unsurprisingly so bad compared to your CZcams series. I wish I could have sent that money to you. Thanks a lot, mate! 🤩
This series is awesome. Thank you. (Your accent/dialect reminds me of James Veitch.)
best node.js tutorial ever
Great Tutorial!
Thank You Shaun 😊
thank you...best tutorials ever :)))
thank you so much for creating this great content
Thank you for the amazing content 😍😍
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!)
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.
Fantastic explanation. Thank you!
You're very welcome! Hope it was helpful :)
even being spanish speaker, you are very understandable, thanks for your knowledge
Just what I needed
I didn't know that use() could used like default in switch statement, interesting thought
thanks for such an amazing series.
Thanks Piyush!
@@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.
great content, sir
You are the best !
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!
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
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.
im taking codecademy and Angela Yu's udemy course. This taught me Node better than everything else
Which extend u have for the little files icon?
And ty so much for the vids mate!!
AMAZING!!!!
Tnx infinity Legend ❤️🤘😊
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.
Why are you soo good ? 😂❤. Excellent teaching.
Haha, thank you! 😃
Hey Ninja :) will you once make a playlist on how to create browser extensions?
Awesome video
Thx!
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
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 ?
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.
ooooh weeeee express here we come
express ---- elegant
Can you tell us your vscode themes? It's just so beautiful.
Brilliant
You are awesome ❤️
Thank you :)
Thanks
well i love your voice ❤
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
my npm packages arent getting added in the dependecy object in the json file. can anyone help?
you're awesome
5:37 I couldn't get "home page" on running app.js, I got index.html code instead. To get the output I changed the port number in server.js to 3001 and then I got the "home page" output. anyone please help to correct this
@6:43 res.send('home page') gives me a green light, but a status of 304 not modified. Can anyone explain? Thanks!
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..!!!
@@rajapriyadharshinims245 Thank you
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.
Just try re-installing nodemon globally.
why you didnt use the .end() method everytime you send a file
Sir when I'm using app.use for Error 404 page status code is not changing why?
thanks
Heyy someone help me as don't know where to apply for job
And how should my cv looklike
1000 Billion Likes from London
hey is redux a good option for large mern stack apps when compared to context and hooks???
or context + hooks are better ??
In my opinion - hooks + redux are great solutions, if you want to build an app in MERN stack.
which theme you used
Fan dabby dozey.
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?
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?
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
Hey, yeah you can use node to run an api which flutter can communicate with.
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?
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 :)
@@NetNinja Okay, thanks! I will watch both not to lose anything :D
great
But i try as you mention the status code is 301 Not Modified do you know why?