Express.js Tutorial for Beginners | Learn the MVC Pattern | Build a Weather Finder App

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

This is literally the best video explanation of the MVC design pattern! Thanks a million. I've understood it now!!! Thanks again. I'm so happy.

jamjam
Автор

Very helpful & complete tutorial! A couple things I would add:

1) install nodemon
Since it can get quite cumbersome to keep on restarting the terminal console, you may consider installing nodemon. This way you will not need to press Ctrl^C to restart the process each time; nodemon will restart by itself (after saving changes).

2) install dotenv
If you followed by coding along, you may also want to upload this demo project to GitHub. However, you never want to expose your API keys. Those are considered sensitive information. Instead, you should create a .env file containing your API key. It will be a hidden file; create it directly in your project folder. Then require the dot-env module in your controller file, like so: '.env'}). This will import the dotenv module, and establish the path to the file. The last step is to create a .gitignore file, and make sure you ignore that .env file. You should always ignore node_modules and package-lock.json, as to avoid having these files uploaded or committed to GitHub.

Install commands:
~>: npm i nodemon

~>: npm i dotenv

deniskomarov
Автор

I rarely comment on youtube videos. But Men! You earn more than a comment. You just earned a new subscriber.

omoniyiipaye
Автор

You got me right on track so I could catch on after that. Thank you for that.

smoomsvr
Автор

Thanks a ton. Really u r the man... the SUPERMAN ❤️❤️❤️.. I have spent thousands of of time to understand the m even I wrote millions of line code but I didn't find anything like this in my life. Great explanation and Great job. Bless you. ❤️❤️❤️❤️

shahipapon
Автор

Such a good training video. I'm beginning to see value in this because for new developers, they will never get on the train of making their project scalable if they only place their application files in a single root directory. this practice gets us all on board to truly know what scalable means.

kensleylewis
Автор

Thank you so much for resuming making the videos! You are the most understandable teacher

s
Автор

Nicely organized explanation of MVC. Thank you.

bretrogers
Автор

Shouldn't all data-access functions be inside model and all the 'logic' checking for example if user typed empty string inside controllers?

resu
Автор

Thanks for taking the time to do this tutorial Hamza. I could run the code without the middleware, I checked the docs on expressjs and it says the middleware is optional, with the exception of the app.set("view engine", "hbs") so you don't specify the file extension, do you see the need for the middleware?

tarick
Автор

Great tutorial. By the way, what theme do you use for you iterm terminal?

backendfyi
Автор

@27:05 I am getting this error Failed to lookup view "index" in views directory "views"

tarunkumararcot
Автор

excellent video. I have a question how can I apply the asynchronous tasks that the model communicates with the controller?

andresfelipe
Автор

Wouldnt it make more sense to do the request to the endpoint in the model? And call it as a callback in the controller instead? Like you said the controller handles the logic and is basically the middleman but by fetching data its acting more as a model instead of the middleman. Or am I misunderstanding something here..

iamchets
Автор

so M in MVC is just for form validation? I heard somewhere else that M is supposed to be the database.

andrewcbuensalida
Автор

What is the font you are using in vs code

nithinharsha
Автор

Hey, thanks for the tutorial. I will have a few questions.
For the sake of being organised, should i create a router FOLDER inside my src folder and create different router FILES inside that?

For example if I have authentication routes and blog routes and both of them have more than 5 or 6 routes, is it good practice to make two seperate router files named authRouter.js and blogRouter.js inside the main router folder?

yasin_osman
Автор

Very good tutorial, One issue I faced is, I had to remove the line "app.use(express.json)" from my code to run it successfully. Could you please explain possible reason for that?

JS-zmse
Автор

One this we might need is to handle a city name that is invalid, cuz when i enter an invalid city name things start breaking...

eddiechen
Автор

Please what's the font of your text editor?

jamjam
visit shbcf.ru