Це відео не доступне.
Перепрошуємо.
MERN Stack Tutorial #2 - Express App Setup
Вставка
- Опубліковано 14 чер 2022
- 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 UA-cam - • Node.js Crash Course T...
💻 MongoDB Crash Course:
On Net Ninja Pro - netninja.dev/p...
On UA-cam - • Complete MongoDB Tutor...
💻 React Full Courses:
On Net Ninja Pro - netninja.dev/p...
On Udemy - www.thenetninj...
On UA-cam - • Full React Tutorial #1...
🔥🔥🔥 Other resources:
React Context & Hooks tutorial (on UA-cam) - • React Context & Hooks ...
VS Code - code.visualstu...
MongoDB Atlas -www.mongodb.co...
POSTMAN - www.postman.co...
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!
Thanks Aaron :)
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
This is one of most comprehensive tutorial series I watched. Kudos !
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.
This will be the best MERN course ever 😍😍😍 I'm so excited 🌟🌟
Thank you for sharing these tutorials with us! They are priceless!
You are so welcome Perla! Hope they are helpful :)
Shawn please make in-depth series. Kudos your efforts. It helps students a lot.
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.
Yes Shawn please 🙏
@@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.
@@streamx2 thanks brother.
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
Great to hear! :) thanks Edgar
I Just love the way you approach the topics.
Thanks, I appreciate that! :)
Best explanation of Middle-ware I've heard. Thanks
No probs! Thanks for the dab Tony :)
really good explanation I started flutter with your tutorial and now I am watching MERN Thanks bro
Your videos help me to really love JS and every JS framework.
Thank you so much for all the effort
15:19 how did "/hello" come in the path?
and also where did the POST request come from?
Someone please clarify
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.
I suggest replaying that part again and listen just once more.
Superb and your clarification for every code is really appreciated ❤
I hope you include info how to push updated files to github, and then auto upload to host server (with one command)
A big thank you! I learned a great concept here!
You're very welcome! :)
Best teacher ever
Thanks m'lord! :)
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?
Hey, route handler functions are still technically middleware. app.use('/api', someRoutes) just applies all the someRoutes handler functions to the '/api' route.
@@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.
Every hero don't wear capes.
Thank you very much..
Very informative course... please continue
DUDE. you explain things so well. thank you!
Thanks Net Ninja!
You are the best teacher I have ever seen
thank you so much!! this video is helping me to put the pieces together!
Let's go for 1m shaun!
I seconded the motion!
such valuable content. thx for sharing man! 💯
Thanks Mariano :)
I use Thunder client for VS Code a lightweight Rest Client for Testing APIs
This tutorial comes right when i need it :)
This is the best.
i am really glad i found this.
thnaks man, thanks a lot.
Glad it helped! :) welcome aboard.
You are simply the best……
Your number one fan, I will be glad if you can help dive into Redux as well……
guys when i use .env file ( for storing my port no) and access it from server .js it is showing listening on port undefined .
i found the solution : import 'dotenv/config' the reason is u have to convert from cjs module to es module
great lesson 😍
Thank you! :)
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. :/
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
love it!, detailed explanation.
after the middleware code at the end
i'm not getting
/GET
/POST on terminal
i tried, please help
loved it!
hie guys im using windows 10 and the npm start is not showing anything at all like the browser is not even opening
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
Thanks for the great tutorials
You're very welcome :) thanks for the support!
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,
Hey Shawn, thanks for the course, Can you please include typescript in the course for both backend and frontend ?
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?
Thanks!
Thank you so much for your support Muhammad :)
Thank you very much!
You're welcome :)
Thank you for this
I am receiving "listening on port undefined" Who can help?
Same here
@@jevinmakwana6811 You need to make sure you include: require('dotenv').config() at the top of your server.js file 9:55
You are da best!!!
can u tell me how does /hello comes on the console @15.14?
Why are we still using commonjs and not ES6
dockerizing this project! =]
Hi
after typing npm init -y, it shows error. This is macbook and i do not know if it is different.
Should we install express in every application ??
I'm using the RapidAPI extension for VS code instead of postman =]
same
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 :)
run it with 'npm run start' it will work.
It's still not working. Can you help me?
@@afshanFaryad issue with nodemon? Try node's native watch functionality, see what happens
process.env.PORT is not working for me. WTF?
i had the same problem you have to save the env file.
Ensure it is written exactly like "PORT=4000" and not "PORT = 4000" or "PORT=4000;"
Awesome video ++++++++++++++++++ 🙂
thanks
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?
when you start the server, make sure you are in the "backend" folder and not in the "mern stack" one
Hello, Shaun, can you make a tutorial about multiple player game with react/vue/svelte + firebase version 9 ? 😊
Need a roadmap video to follow your channel content!!!!
thx
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.
It probably is safe. It was likely just a security measure added in later just in case
"Why do you send responses in JSON format? Is it always necessary to do it that way?
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.
Hi I saw some people using import, export instead of require why??? and why you using require??
I tried to use import to import express but it was breaking. It only worked with require
Nice vídeos
I have installed nodemon pkg but nodemon is not working
same'
the port is not working getting error
"If off screen i made a few request", how did you do it?
you can type in your postman, example : localhost:400/.... -> .... it means your request
code: 'MODULE_NOT_FOUND',
how do I fix this problem
Make sure all the code is within the backend folder. That was my issue
why not use a "use" property rather than get
❤️
Sir video is corrupted only voice is coming
Please use semicolons.
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"
you are the goat
Hello teacher, i have a question, math is important to software engineer?
can i do better math?
math is for game devs
Done do done lo ✅👍
A
oh hello mind reader
{2023-02-18}
first
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.
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.
@@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
@@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.
@@kevinerose I got it working - I had .env in the root instaed of the folder backend...
@@JimKernix Thank you for your comment! I made the same mistake.
🤍
Hi Shawn, Is this MERN app come up with @reduxjs/tookit(RTK)..?