Це відео не доступне.
Перепрошуємо.

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...

КОМЕНТАРІ • 130

  • @aarongoulding4025
    @aarongoulding4025 2 роки тому +48

    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!

  • @milkmanex1
    @milkmanex1 Рік тому +4

    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

  • @user-ow8im4dd5o
    @user-ow8im4dd5o 6 місяців тому +3

    This is one of most comprehensive tutorial series I watched. Kudos !

  • @amulsharma564
    @amulsharma564 7 днів тому

    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.

  • @isaacqadri
    @isaacqadri 2 роки тому +5

    This will be the best MERN course ever 😍😍😍 I'm so excited 🌟🌟

  • @perlaabdallah7754
    @perlaabdallah7754 2 роки тому +6

    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 роки тому +3

    Shawn please make in-depth series. Kudos your efforts. It helps students a lot.

  • @dthierno
    @dthierno 2 роки тому +44

    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 роки тому +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.

  • @diverStacks
    @diverStacks Рік тому +1

    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  Рік тому

      Great to hear! :) thanks Edgar

  • @abdulhasibn1022
    @abdulhasibn1022 Рік тому +1

    I Just love the way you approach the topics.

    • @NetNinja
      @NetNinja  Рік тому

      Thanks, I appreciate that! :)

  • @amoebacakes
    @amoebacakes 2 роки тому +2

    Best explanation of Middle-ware I've heard. Thanks

    • @NetNinja
      @NetNinja  2 роки тому +1

      No probs! Thanks for the dab Tony :)

  • @aymanomara8468
    @aymanomara8468 Рік тому

    really good explanation I started flutter with your tutorial and now I am watching MERN Thanks bro

  • @mourabitiy
    @mourabitiy 2 роки тому

    Your videos help me to really love JS and every JS framework.
    Thank you so much for all the effort

  • @vibhupratap441
    @vibhupratap441 Рік тому +4

    15:19 how did "/hello" come in the path?
    and also where did the POST request come from?
    Someone please clarify

    • @user-mo5tm2qf4j
      @user-mo5tm2qf4j 10 місяців тому +3

      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.

    • @user-mo5tm2qf4j
      @user-mo5tm2qf4j 10 місяців тому +1

      I suggest replaying that part again and listen just once more.

  • @vimukthaariyasinghe8041
    @vimukthaariyasinghe8041 11 місяців тому

    Superb and your clarification for every code is really appreciated ❤

  • @pastuh
    @pastuh 2 роки тому +2

    I hope you include info how to push updated files to github, and then auto upload to host server (with one command)

  • @jayashriborse8783
    @jayashriborse8783 2 роки тому +1

    A big thank you! I learned a great concept here!

    • @NetNinja
      @NetNinja  2 роки тому +1

      You're very welcome! :)

  • @starlords.7788
    @starlords.7788 29 днів тому

    Best teacher ever

    • @NetNinja
      @NetNinja  29 днів тому

      Thanks m'lord! :)

  • @streamx2
    @streamx2 2 роки тому +4

    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.

  • @sumanth7211
    @sumanth7211 2 роки тому

    Every hero don't wear capes.
    Thank you very much..

  • @ak2005
    @ak2005 2 роки тому +1

    Very informative course... please continue

  • @Dannyboyjr
    @Dannyboyjr Рік тому +3

    DUDE. you explain things so well. thank you!

  • @CreativeStudio0803
    @CreativeStudio0803 15 днів тому

    Thanks Net Ninja!

  • @thethinhobbies9263
    @thethinhobbies9263 Рік тому

    You are the best teacher I have ever seen

  • @alisonoz7219
    @alisonoz7219 Рік тому

    thank you so much!! this video is helping me to put the pieces together!

  • @ryanchristiansacdalan7104
    @ryanchristiansacdalan7104 2 роки тому +1

    Let's go for 1m shaun!

  • @marianoandresbalino8869
    @marianoandresbalino8869 2 роки тому +1

    such valuable content. thx for sharing man! 💯

    • @NetNinja
      @NetNinja  2 роки тому +1

      Thanks Mariano :)

  • @rahim.tn99
    @rahim.tn99 2 роки тому +1

    I use Thunder client for VS Code a lightweight Rest Client for Testing APIs

  • @nevos6231
    @nevos6231 2 роки тому

    This tutorial comes right when i need it :)

  • @NeoCodez
    @NeoCodez Рік тому

    This is the best.
    i am really glad i found this.
    thnaks man, thanks a lot.

    • @NetNinja
      @NetNinja  Рік тому +1

      Glad it helped! :) welcome aboard.

  • @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……

  • @bullymaguire2335
    @bullymaguire2335 Місяць тому +1

    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 Місяць тому +1

      i found the solution : import 'dotenv/config' the reason is u have to convert from cjs module to es module

  • @maskman4821
    @maskman4821 2 роки тому +1

    great lesson 😍

  • @geeno123
    @geeno123 2 роки тому +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

  • @funvid691
    @funvid691 2 роки тому

    love it!, detailed explanation.

  • @deepvoyager01
    @deepvoyager01 4 дні тому

    after the middleware code at the end
    i'm not getting
    /GET
    /POST on terminal
    i tried, please help

  • @MuhammadUsman-jc7oq
    @MuhammadUsman-jc7oq 4 місяці тому

    loved it!

  • @ntcc2821
    @ntcc2821 Рік тому +1

    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 7 місяців тому

      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

  • @mrgrossartig
    @mrgrossartig Рік тому

    Thanks for the great tutorials

    • @NetNinja
      @NetNinja  Рік тому

      You're very welcome :) thanks for the support!

  • @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,

  • @joshymathew1555
    @joshymathew1555 2 роки тому

    Hey Shawn, thanks for the course, Can you please include typescript in the course for both backend and frontend ?

  • @manjubashinij5094
    @manjubashinij5094 4 місяці тому

    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?

  • @imranonthenet
    @imranonthenet Рік тому +1

    Thanks!

    • @NetNinja
      @NetNinja  Рік тому

      Thank you so much for your support Muhammad :)

  • @elgato2717
    @elgato2717 Рік тому

    Thank you very much!

  • @otukenn79
    @otukenn79 2 роки тому

    Thank you for this

  • @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

  • @lukababunadze6448
    @lukababunadze6448 2 роки тому

    You are da best!!!

  • @jayasan1649
    @jayasan1649 Місяць тому

    can u tell me how does /hello comes on the console @15.14?

  • @AbhishekVaid
    @AbhishekVaid 2 місяці тому

    Why are we still using commonjs and not ES6

  • @chadgregory9037
    @chadgregory9037 2 роки тому

    dockerizing this project! =]

  • @user-ds1cq1do3l
    @user-ds1cq1do3l 11 місяців тому

    Hi
    after typing npm init -y, it shows error. This is macbook and i do not know if it is different.

  • @SaiBaba-zi5my
    @SaiBaba-zi5my 7 місяців тому

    Should we install express in every application ??

  • @chadgregory9037
    @chadgregory9037 2 роки тому

    I'm using the RapidAPI extension for VS code instead of postman =]

  • @alexpiano
    @alexpiano 2 роки тому +4

    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 10 місяців тому

      run it with 'npm run start' it will work.

    • @afshanFaryad
      @afshanFaryad 7 місяців тому

      It's still not working. Can you help me?

    • @alexpiano
      @alexpiano 7 місяців тому

      @@afshanFaryad issue with nodemon? Try node's native watch functionality, see what happens

  • @JimKernix
    @JimKernix 2 роки тому +2

    process.env.PORT is not working for me. WTF?

    • @farhaanpatel5302
      @farhaanpatel5302 2 роки тому +2

      i had the same problem you have to save the env file.

    • @hmzmh2020
      @hmzmh2020 11 місяців тому +1

      Ensure it is written exactly like "PORT=4000" and not "PORT = 4000" or "PORT=4000;"

  • @mohamedyoussef8835
    @mohamedyoussef8835 Рік тому

    Awesome video ++++++++++++++++++ 🙂

  • @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

  • @maskman4821
    @maskman4821 2 роки тому

    Hello, Shaun, can you make a tutorial about multiple player game with react/vue/svelte + firebase version 9 ? 😊

  • @prafulrane3591
    @prafulrane3591 Рік тому

    Need a roadmap video to follow your channel content!!!!

  • @michalnowak2181
    @michalnowak2181 Рік тому

    thx

  • @user-mw7fq3jv9y
    @user-mw7fq3jv9y 8 місяців тому

    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 7 місяців тому

      It probably is safe. It was likely just a security measure added in later just in case

  • @user-vu7fs3mf7b
    @user-vu7fs3mf7b Рік тому

    "Why do you send responses in JSON format? Is it always necessary to do it that way?

    • @user-mo5tm2qf4j
      @user-mo5tm2qf4j 10 місяців тому

      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.

  • @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

  • @afshanFaryad
    @afshanFaryad 7 місяців тому

    I have installed nodemon pkg but nodemon is not working

  • @omare4682
    @omare4682 Рік тому

    the port is not working getting error

  • @jemuelmanacsa
    @jemuelmanacsa 11 місяців тому

    "If off screen i made a few request", how did you do it?

    • @muhamadalifanwar4037
      @muhamadalifanwar4037 6 місяців тому

      you can type in your postman, example : localhost:400/.... -> .... it means your request

  • @ledouxthephotoboss7441
    @ledouxthephotoboss7441 Рік тому +1

    code: 'MODULE_NOT_FOUND',
    how do I fix this problem

    • @jeremybrews2521
      @jeremybrews2521 Місяць тому

      Make sure all the code is within the backend folder. That was my issue

  • @theenilenation
    @theenilenation 2 роки тому

    why not use a "use" property rather than get

  • @RandomGuy-hv7tb
    @RandomGuy-hv7tb 2 роки тому

    ❤️

  • @maheshkumar-tv8gt
    @maheshkumar-tv8gt Рік тому

    Sir video is corrupted only voice is coming

  • @bryceblazegamingyt9741
    @bryceblazegamingyt9741 Рік тому

    Please use semicolons.

  • @kadhiranandv7864
    @kadhiranandv7864 4 місяці тому

    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"

  • @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

  • @Guriyaajay1234
    @Guriyaajay1234 2 роки тому

    Done do done lo ✅👍

  • @geethakatakam573
    @geethakatakam573 2 місяці тому

    A

  • @zaouiamine6475
    @zaouiamine6475 2 роки тому

    oh hello mind reader

  • @Pareshbpatel
    @Pareshbpatel Рік тому

    {2023-02-18}

  • @lukem121
    @lukem121 2 роки тому

    first

  • @JimKernix
    @JimKernix 2 роки тому +3

    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 роки тому +1

      @@kevinerose I got it working - I had .env in the root instaed of the folder backend...

    • @elgato2717
      @elgato2717 Рік тому

      @@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)..?