Тёмный

MERN Stack Tutorial #2 - Express App Setup 

Net Ninja
Подписаться 1,6 млн
Просмотров 178 тыс.
50% 1

Hey gang, in this MERN tutorial we'll set up our initial Express app to power the backend api.
⭐⭐ Get the full course now (without ads) on the Net Ninja Pro site:
netninja.dev/p...
⭐⭐ Get access to all free & PREMIUM courses on Net Ninja Pro:
net-ninja-pro....
🥷 Course Files (GitHub):
github.com/iam...
💻 Node.js & Express Crash Course:
On Net Ninja Pro - netninja.dev/p...
On RU-vid - • Node.js Crash Course T...
💻 MongoDB Crash Course:
On Net Ninja Pro - netninja.dev/p...
On RU-vid - • Complete MongoDB Tutor...
💻 React Full Courses:
On Net Ninja Pro - netninja.dev/p...
On Udemy - www.thenetninj...
On RU-vid - • Full React Tutorial #1...
🔥🔥🔥 Other resources:
React Context & Hooks tutorial (on RU-vid) - • React Context & Hooks ...
VS Code - code.visualstu...
MongoDB Atlas -www.mongodb.co...
POSTMAN - www.postman.co...

Опубликовано:

 

6 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 133   
@aarongoulding4025
@aarongoulding4025 2 года назад
I just love how this guy always gets straight to it with no fluff to make the videos longer than necessary without leaving out the important conceptual bits!
@NetNinja
@NetNinja 2 года назад
Thanks Aaron :)
@irindukodithuwakku8645
@irindukodithuwakku8645 Месяц назад
​@@NetNinja can i still do this on the latest versions.
@milkmanex1
@milkmanex1 Год назад
I always come back to net ninja. HANDS DOWN best teacher. Perfectly articulated, pleasant sounding voice, no stuttering, hiccups or anything annoying. I've watched so many tutorials over the years and none of them come close to your level. If any course deserves my godamn money, its yours
@sandevv-k7q
@sandevv-k7q 8 месяцев назад
This is one of most comprehensive tutorial series I watched. Kudos !
@dthierno
@dthierno 2 года назад
Hey Shawn, thanks for this free course. Was wondering if you could also show us how to deploy the app, as it may be very helpful for us.
@jasmin_bheda
@jasmin_bheda 2 года назад
Yes Shawn please 🙏
@streamx2
@streamx2 2 года назад
@@jasmin_bheda He talked about another series after this where he will add authentication to the app, so maybe deploying it will be part of that course.
@jasmin_bheda
@jasmin_bheda 2 года назад
@@streamx2 thanks brother.
@amulsharma564
@amulsharma564 Месяц назад
This is what I was looking for, Because I want to learn mern stack ASAP without missing any important concept. You are covering every important bit of it. I loved it, Thanks once Again.
@towatch
@towatch 2 года назад
This will be the best MERN course ever 😍😍😍 I'm so excited 🌟🌟
@perlaabdallah7754
@perlaabdallah7754 2 года назад
Thank you for sharing these tutorials with us! They are priceless!
@NetNinja
@NetNinja 2 года назад
You are so welcome Perla! Hope they are helpful :)
@husler7424
@husler7424 2 года назад
Shawn please make in-depth series. Kudos your efforts. It helps students a lot.
@amoebacakes
@amoebacakes 2 года назад
Best explanation of Middle-ware I've heard. Thanks
@NetNinja
@NetNinja 2 года назад
No probs! Thanks for the dab Tony :)
@diverStacks
@diverStacks 2 года назад
you sir are a savior 🙏 While on this journey I have forgotten how to implement backend on my application & have been stuck on this for 3 days now 🤣 I hope part 3 continues to amaze me. Keep up the good work
@NetNinja
@NetNinja 2 года назад
Great to hear! :) thanks Edgar
@abdulhasibn1022
@abdulhasibn1022 Год назад
I Just love the way you approach the topics.
@NetNinja
@NetNinja Год назад
Thanks, I appreciate that! :)
@aymanomara8468
@aymanomara8468 Год назад
really good explanation I started flutter with your tutorial and now I am watching MERN Thanks bro
@vimukthaariyasinghe8041
@vimukthaariyasinghe8041 Год назад
Superb and your clarification for every code is really appreciated ❤
@thethinhobbies9263
@thethinhobbies9263 Год назад
You are the best teacher I have ever seen
@jayashriborse8783
@jayashriborse8783 2 года назад
A big thank you! I learned a great concept here!
@NetNinja
@NetNinja 2 года назад
You're very welcome! :)
@mourabitiy
@mourabitiy 2 года назад
Your videos help me to really love JS and every JS framework. Thank you so much for all the effort
@sumanth7211
@sumanth7211 2 года назад
Every hero don't wear capes. Thank you very much..
@ak2005
@ak2005 2 года назад
Very informative course... please continue
@pastuh
@pastuh 2 года назад
I hope you include info how to push updated files to github, and then auto upload to host server (with one command)
@streamx2
@streamx2 2 года назад
I bought the course on your website and have a question. You talk about middleware and use app.use but then in video 3, you also use app.use to create routes. How does that work, i thought app.use is for middleware?
@NetNinja
@NetNinja 2 года назад
Hey, route handler functions are still technically middleware. app.use('/api', someRoutes) just applies all the someRoutes handler functions to the '/api' route.
@streamx2
@streamx2 2 года назад
@@NetNinja Thank you, you replied to me on Twitter. I continued watching the series, I'm on the React Context video right now. I will code along once I have watched all the videos first.
@marianoandresbalino8869
@marianoandresbalino8869 2 года назад
such valuable content. thx for sharing man! 💯
@NetNinja
@NetNinja 2 года назад
Thanks Mariano :)
@alisonoz7219
@alisonoz7219 2 года назад
thank you so much!! this video is helping me to put the pieces together!
@Dannyboyjr
@Dannyboyjr Год назад
DUDE. you explain things so well. thank you!
@starlords.7788
@starlords.7788 2 месяца назад
Best teacher ever
@NetNinja
@NetNinja 2 месяца назад
Thanks m'lord! :)
@CreativeStudio0803
@CreativeStudio0803 2 месяца назад
Thanks Net Ninja!
@nevos6231
@nevos6231 2 года назад
This tutorial comes right when i need it :)
@vibhupratap441
@vibhupratap441 Год назад
15:19 how did "/hello" come in the path? and also where did the POST request come from? Someone please clarify
@AndrewJot-z9l
@AndrewJot-z9l Год назад
If you listened carefully to what Shaun said, OFF SCREEN (in his other screen) he actually typed the path "/hello". He's just trying to show you that "console.log(req.path, req.method)" works. Similarly, he used the postman environment to simulate POST request. I hope this helps.
@AndrewJot-z9l
@AndrewJot-z9l Год назад
I suggest replaying that part again and listen just once more.
@ryanchristiansacdalan7104
@ryanchristiansacdalan7104 2 года назад
Let's go for 1m shaun!
@umarmohammed3241
@umarmohammed3241 2 года назад
I seconded the motion!
@emmanuelogunleye777
@emmanuelogunleye777 2 года назад
You are simply the best…… Your number one fan, I will be glad if you can help dive into Redux as well……
@NeoCodez
@NeoCodez Год назад
This is the best. i am really glad i found this. thnaks man, thanks a lot.
@NetNinja
@NetNinja Год назад
Glad it helped! :) welcome aboard.
@rahim.tn99
@rahim.tn99 2 года назад
I use Thunder client for VS Code a lightweight Rest Client for Testing APIs
@maskman4821
@maskman4821 2 года назад
great lesson 😍
@NetNinja
@NetNinja 2 года назад
Thank you! :)
@MuhammadUsman-jc7oq
@MuhammadUsman-jc7oq 6 месяцев назад
loved it!
@funvid691
@funvid691 2 года назад
love it!, detailed explanation.
@sadam_khan
@sadam_khan Год назад
if your code is generating port file, then do a thing to fix it, make a PORT variable at the top like const PORT = process.env.PORT; and now use PORT variable in the listen method. it worked for me,
@mrgrossartig
@mrgrossartig Год назад
Thanks for the great tutorials
@NetNinja
@NetNinja Год назад
You're very welcome :) thanks for the support!
@joshymathew1555
@joshymathew1555 2 года назад
Hey Shawn, thanks for the course, Can you please include typescript in the course for both backend and frontend ?
@imranonthenet
@imranonthenet Год назад
Thanks!
@NetNinja
@NetNinja Год назад
Thank you so much for your support Muhammad :)
@otukenn79
@otukenn79 2 года назад
Thank you for this
@geeno123
@geeno123 2 года назад
Great video series! Question. Is anyone having trouble with requiring express, router etc? I keep getting an error saying module is not defined in ES module scope Even when I add "type:"module to my package.json file. I still get the same crash error. I've tried using both require and import.. Still getting errors. :/
@smissu1
@smissu1 2 года назад
I had the same problem:( Make sure your files are all located in the “backend” folder. My files/folders i.e. package.json, node_modules were located in the “MERN STACK” folder
@alexpiano
@alexpiano 2 года назад
If anyone is experiencing odd behaviour of nodemon, basically not working, I did the following: npm i -dev nodemon@1.18.3 this is installs nodemon locally as a dev dependency that you'll use during development and this particular version works fine for me. Hope it helps someone :)
@anneseb8159
@anneseb8159 Год назад
run it with 'npm run start' it will work.
@afshanFaryad
@afshanFaryad 9 месяцев назад
It's still not working. Can you help me?
@alexpiano
@alexpiano 9 месяцев назад
@@afshanFaryad issue with nodemon? Try node's native watch functionality, see what happens
@chadgregory9037
@chadgregory9037 2 года назад
I'm using the RapidAPI extension for VS code instead of postman =]
@BilalAhmed-tw5cr
@BilalAhmed-tw5cr 2 года назад
same
@ntcc2821
@ntcc2821 Год назад
hie guys im using windows 10 and the npm start is not showing anything at all like the browser is not even opening
@lifestylenounou3452
@lifestylenounou3452 9 месяцев назад
i got the same issue with windows 10, i got some message error like 'nodemon: command not found' same thing for react npm start i got scripts not recognized! every thing is installed and existing in jason package but when i run the code i got unkown command
@prafulrane3591
@prafulrane3591 Год назад
Need a roadmap video to follow your channel content!!!!
@JimKernix
@JimKernix 2 года назад
process.env.PORT is not working for me. WTF?
@farhaanpatel5302
@farhaanpatel5302 2 года назад
i had the same problem you have to save the env file.
@lukababunadze6448
@lukababunadze6448 2 года назад
You are da best!!!
@maskman4821
@maskman4821 2 года назад
Hello, Shaun, can you make a tutorial about multiple player game with react/vue/svelte + firebase version 9 ? 😊
@elgato2717
@elgato2717 2 года назад
Thank you very much!
@NetNinja
@NetNinja 2 года назад
You're welcome :)
@SaiBaba-zi5my
@SaiBaba-zi5my 8 месяцев назад
Should we install express in every application ??
@elgato2717
@elgato2717 2 года назад
I am receiving "listening on port undefined" Who can help?
@jevinmakwana6811
@jevinmakwana6811 Год назад
Same here
@seanmythen
@seanmythen Год назад
@@jevinmakwana6811 You need to make sure you include: require('dotenv').config() at the top of your server.js file 9:55
@chadgregory9037
@chadgregory9037 2 года назад
dockerizing this project! =]
@bullymaguire2335
@bullymaguire2335 3 месяца назад
guys when i use .env file ( for storing my port no) and access it from server .js it is showing listening on port undefined .
@bullymaguire2335
@bullymaguire2335 3 месяца назад
i found the solution : import 'dotenv/config' the reason is u have to convert from cjs module to es module
@AbhishekVaid
@AbhishekVaid 4 месяца назад
Why are we still using commonjs and not ES6
@doniaelfouly4142
@doniaelfouly4142 Год назад
thanks
@yakir99701
@yakir99701 2 года назад
Thank you so much for all the amazing tutorials, I have a little question, after each change of the code the nodemon is "restarting" the server but it gets stuck there and not starting the server.. any solutions to this problem?
@franciscosantos7706
@franciscosantos7706 2 года назад
when you start the server, make sure you are in the "backend" folder and not in the "mern stack" one
@ManassehAnandet
@ManassehAnandet Год назад
Hi after typing npm init -y, it shows error. This is macbook and i do not know if it is different.
@yashtonapi220
@yashtonapi220 Месяц назад
"MODULE_NOT_FOUND" how to fix this error idk what wrong I did, I have node installed still not working
@mohamedyoussef8835
@mohamedyoussef8835 Год назад
Awesome video ++++++++++++++++++ 🙂
@manjubashinij5094
@manjubashinij5094 5 месяцев назад
Hey there, I'm stuck on your 9th video in the playlist because I keep running into a CORS error while trying to use a proxy. The error message keeps popping up saying: "Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.allowedHosts[0] should be a non-empty string." I'm a big fan from India, and I was wondering if you could help me out with this issue?
@syrup8345
@syrup8345 2 года назад
Hi I saw some people using import, export instead of require why??? and why you using require??
@franciscosantos7706
@franciscosantos7706 2 года назад
I tried to use import to import express but it was breaking. It only worked with require
@outletshelssy
@outletshelssy 2 года назад
Nice vídeos
@theenilenation
@theenilenation 2 года назад
why not use a "use" property rather than get
@MatiasMendoza-d8s
@MatiasMendoza-d8s Год назад
"Why do you send responses in JSON format? Is it always necessary to do it that way?
@AndrewJot-z9l
@AndrewJot-z9l Год назад
Shaun just wants to demonstrate how to send some data back to the browser, which can be displayed on the screen in the EASIEST way. Normally, we would send a html file back to the browser like res.sendFile('/index.html'), which we need to create. But in this tutorial, we just want to send some data back, so JSON is the easiest way.
@michalnowak2181
@michalnowak2181 2 года назад
thx
@omare4682
@omare4682 Год назад
the port is not working getting error
@jayasan1649
@jayasan1649 2 месяца назад
can u tell me how does /hello comes on the console @15.14?
@ledouxthephotoboss7441
@ledouxthephotoboss7441 Год назад
code: 'MODULE_NOT_FOUND', how do I fix this problem
@jeremybrews2521
@jeremybrews2521 2 месяца назад
Make sure all the code is within the backend folder. That was my issue
@jemuelmanacsa
@jemuelmanacsa Год назад
"If off screen i made a few request", how did you do it?
@muhamadalifanwar4037
@muhamadalifanwar4037 7 месяцев назад
you can type in your postman, example : localhost:400/.... -> .... it means your request
@maheshkumar-tv8gt
@maheshkumar-tv8gt Год назад
Sir video is corrupted only voice is coming
@محمد-ح5س7ز
@محمد-ح5س7ز 10 месяцев назад
I am getting an error when I use nodemon saying cannot be loaded because running scripts is disabled on this system. I asked chatGPT and he say that i have to Change Execution Policy for PowerShell. at the end he says that it might be risky. my question is , is it safe to change them. have anyone tried this.
@flowingwind2199
@flowingwind2199 9 месяцев назад
It probably is safe. It was likely just a security measure added in later just in case
@afshanFaryad
@afshanFaryad 9 месяцев назад
I have installed nodemon pkg but nodemon is not working
@aniketdas4358
@aniketdas4358 7 месяцев назад
same'
@bryceblazegamingyt9741
@bryceblazegamingyt9741 Год назад
Please use semicolons.
@deepvoyager01
@deepvoyager01 Месяц назад
after the middleware code at the end i'm not getting /GET /POST on terminal i tried, please help
@ilhammorsalin2503
@ilhammorsalin2503 Месяц назад
bump
@ilhammorsalin2503
@ilhammorsalin2503 Месяц назад
bump
@RandomGuy-hv7tb
@RandomGuy-hv7tb 2 года назад
❤️
@davidardo4466
@davidardo4466 2 года назад
Hello teacher, i have a question, math is important to software engineer? can i do better math?
@pastuh
@pastuh 2 года назад
math is for game devs
@kadhiranandv7864
@kadhiranandv7864 6 месяцев назад
if you get any script error on 5:21 like "about_Execution_Policies" just right clic your windows start and then choose windows powershell(admin) and then paste it "Set-ExecutionPolicy Unrestricted"
@snapat2023
@snapat2023 6 месяцев назад
you are the goat
@Guriyaajay1234
@Guriyaajay1234 2 года назад
Done do done lo ✅👍
@geethakatakam573
@geethakatakam573 3 месяца назад
A
@lukem121
@lukem121 2 года назад
first
@zaouiamine6475
@zaouiamine6475 2 года назад
oh hello mind reader
@Pareshbpatel
@Pareshbpatel Год назад
{2023-02-18}
@JimKernix
@JimKernix 2 года назад
Did anyone get an error after running nodemon server.js? I gor: nodemon.ps1 cannot be loaded because running scripts is disabled on this system I found a stackoverflow article and tried one option of deleting nodemon.ps1 and it worked, but then I had problems with my laptop. I added the file back and then shutdown - it took over an hour to shut down. I also found 2 different powershell commands to use: 1. set-ExecutionPolicy Unrestricted, and 2. set-ExecutionPolicy RemoteSigned -Scope CurrentUser Does anyone know if they are safe? I really don't want to have any more PC problems. I'm going to have to stop the tutorial here until I get this sorted out.
@kevinerose
@kevinerose 2 года назад
Okay I just set mine to RemoteSigned and left it on default (LocalMachine). Everything turned out good. Ran the nodemon server.js command without any problems.
@JimKernix
@JimKernix 2 года назад
@@kevinerose I used set-ExecutionPolicy RemoteSigned -Scope CurrentUser and taht worked, but process.env.PORT is not working for me. I'm basically stopping because I don't want to continue not knowing what the issue is
@kevinerose
@kevinerose 2 года назад
@@JimKernix Same thing happened to me too. For me the issue with process.env.PORT turned out to be a sequence issue. For it to work, I had to back all the way out ( c) of the dev and the dotenv. Then "install dotenv" followed by "run dev". I had to do a couple iterations before I got it figured out. I think what happens is you are trying to "run dev" but the dotenv somehow uninstalled on you.
@JimKernix
@JimKernix 2 года назад
@@kevinerose I got it working - I had .env in the root instaed of the folder backend...
@elgato2717
@elgato2717 2 года назад
@@JimKernix Thank you for your comment! I made the same mistake.
@Eslam-ig2gf
@Eslam-ig2gf Год назад
🤍
@murali7370
@murali7370 2 года назад
Hi Shawn, Is this MERN app come up with @reduxjs/tookit(RTK)..?
Далее
MERN Stack Tutorial #3 - Express Router & API Routes
13:38
Vite Crash Course | Faster Alternative To CRA
16:24
Просмотров 204 тыс.
How to Become a MERN Stack Developer
6:58
Просмотров 19 тыс.
MERN Stack Tutorial #11 - Adding React Context
26:31
Просмотров 78 тыс.
MERN Stack Tutorial #6 - Controllers (part 1)
14:32
Просмотров 87 тыс.
MERN Tutorial For Beginners | Learn MERN In 60 Minutes
59:40
MERN Stack Tutorial #5 - Models & Schemas
12:43
Просмотров 97 тыс.
How To Use TypeScript With Express & Node
17:05
Просмотров 72 тыс.