Learn The MERN Stack [8] - Prepare & Deploy

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 444

  • @vitoroliveira6170
    @vitoroliveira6170 5 лет назад +134

    If someone is having problems with the deployment, I suggest you go to your cluster at the mongo atlas, then go to the security tab -> ip whitelist -> add new ip -> "Allow access from anywhere" and finally you return to the terminal and do the upload process again, it should work normally.

    • @BonbonLemon
      @BonbonLemon 5 лет назад +1

      This worked for me. Thanks!

    • @dustincintron1682
      @dustincintron1682 5 лет назад +2

      This worked! I was able to deploy to Heroku, but before I did this IP change, the app wasn't getting/working with any Data. Makes perfect sense. Great solution, thanks

    •  5 лет назад +2

      Thanks, it really worked for me also. I did what you said in order to stop and restart the app on heroku using CLI: heroku ps:scale web=0 and heroku ps:scale web=1.

    • @bobannbg
      @bobannbg 5 лет назад

      When index.html is loaded and React tries to get all items, I had "Error: Request failed with status code 503". Your suggestion solved the problem, thanks!

    • @rodmm3010
      @rodmm3010 4 года назад

      fixed it with this solution man. thanks

  • @atikfahad
    @atikfahad 6 лет назад +4

    Hey Brad, I've finished my software engineering course recently. But from last few years I was trying to follow your tutorials and believe me I got most of skills due to you not because of my university! This is the first time I took a course from online and I've started by taking your MERN stack course! :D Thanks man..

  • @hichamelboukkouri8376
    @hichamelboukkouri8376 4 года назад +5

    If you get an error when deploying, see if the error comes after: NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
    If it's the case then check if there is an existing git repository in the ./client/ folder.
    If so, remove it (rm -rf ./client/.git/) and attempt to deploy again.
    This solved the issue for me. Cheers! :)

  • @mohmedishak8853
    @mohmedishak8853 3 года назад

    BRADDDDDDDDDD, I'VE WATCHED AT LEAST 20+ videos and have miserable failed to deploy MERN stack app for months, but finally your tutorial worked. Thank you so much.

  • @SunilKumar-jj8bf
    @SunilKumar-jj8bf 4 года назад

    Thank you so much, there is no other such clear instructions on any blog or videos that I came through on how to deploy MERN Stack app on heroku. I was trying to deploy my app from last 3 days and getting error every time. Thanks to you, it worked in the first go. A big hug.

    • @Karuska22ps
      @Karuska22ps 4 года назад

      howd u get past the 503 error

    • @meda3li
      @meda3li 3 года назад

      For Everyone facing the same problem try to to remove git folder form client retry git process in root directory, that may help!!

  •  3 года назад +2

    Thanks again, Brad.. Since 2018 I have forgotten how many time I came here when I need to deploy something to Heroku.
    Here is my two cents worth:
    If you are using yarn, the script is slightly different since "--prefix" doesn't work with yarn.
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false yarn --cwd ./client install && yarn --cwd ./client build"
    I hope it helps someone! :)

  • @Kradiancy
    @Kradiancy 4 года назад +1

    To anyone struggling to deploy to heroku, I would recommend rebuilding the app from scratch in a new folder with a git repository initialised from the word go. Kind of an oversight on Brad's part here not mentioning it since that is what you would do in a real dev environment, and he himself did it without telling us. Commit changes after adding npm packages, and copy pasting all the business logic. I basically bricked my first attempt trying to untangle the React and Root level git repositories. Remeber to whitelist the connection from heroku in your mongoDB Atlas before deploying, otherwise the app will not display your list items and you'll have to deploy again!

    • @vinram9361
      @vinram9361 4 года назад

      Thank you for the info on the whitelist I was going crazy trying to find a solution. It worked.

  • @joweltisso7365
    @joweltisso7365 4 года назад

    Thanks for the help.. was struggling for the whole day.. and now i am finally able to host my express sever to heroku.. thanks to you.. was able to figure things out.. please keep up the good work...

  • @alessandromarin6499
    @alessandromarin6499 5 лет назад +54

    If it helps, I was getting an error in heroku saying that it could not find the client's package.json:
    remote: npm ERR! path /tmp/build_f7f27006d6fa28c86a392d5806a7420c/client/package.json
    remote: npm ERR! code ENOENT
    ..
    remote: npm ERR! enoent ENOENT: no such file or directory, open
    The problem was the client/.git file automatically generated by react-create-app. see github.com/bradtraversy/mern_shopping_list/issues/7

    • @ncesar
      @ncesar 5 лет назад

      Thanks mate!! cheers

    • @deanrellin7270
      @deanrellin7270 5 лет назад

      Thanks for this!

    • @rohitsancheti96
      @rohitsancheti96 5 лет назад

      Life saving stuff bro

    • @stevecarey2030
      @stevecarey2030 5 лет назад +2

      Thanks. I can stop beating my head against the wall now. Note: I had to delete the git repositories in both the client and root directories and then do a git init in the root directory again.

    • @lardosian
      @lardosian 5 лет назад

      Nice one

  • @Kingrhymer
    @Kingrhymer 2 года назад

    When he said these are the cross your finger moments ... I FELT THAT LMAOOo. Thanks for helping me complete my first fullstack app after all this time

  • @ヨーキ実況
    @ヨーキ実況 4 года назад +4

    For people who got errno 126:
    1. Create a new file named .gitignore in root folder and client folder
    2. Write
    .gitignore
    /node_modules
    3. Run "git rm -r --cached . " in the root folder
    4. Run "git add . " in the root folder
    5. Run "git commit -am 'commit' " in the root folder
    6. Run "git push heroku master" in the root folder

  • @vlad11112
    @vlad11112 6 лет назад +13

    Wow, this was a great learning experience, just bought the udemy course, looking forward to learning some more! Thank you for another great series Brad!

    • @ajricherson1099
      @ajricherson1099 5 лет назад

      Assuming you've completed it by now, can you recommend it? I really like Brad's way of teaching, and I would like to support him, but I am debating this course to some of his other ones.

  • @codingmechanic8954
    @codingmechanic8954 5 лет назад

    Woohoo finally up and running. Half a day of coding along, half a month of debugging. Thank you Brad

  • @ghoul4375
    @ghoul4375 4 года назад

    Thank you thank you thank you Brad! Every tutorial I came across only deomnstrated how to deploy a static hello world react app, and I needed my react hooks and context to work properly. This helped me do just that! I couldnt thank you enough!

  • @TropicalTaquito
    @TropicalTaquito 6 лет назад

    I loved this project! Alot i still need to understand, like redux. It went way over my head, but I'm glad I stopped and did the redux crash course before i went into the redux section on the series so i had an idea what was happening. Thanks Brad!

  • @Fedjz
    @Fedjz 6 лет назад +29

    Nice course Brad, if u are planning to add some authentication, it would be great to see some google sign in instead of the classic username/email and password.

  • @robertkibugi3014
    @robertkibugi3014 4 года назад +1

    If you are having a problem with deployment try this.
    Delete the .git folder in client from your file explorer, ensure that the show hidden files option is checked, then run:
    git rm -f --cached client
    git add .
    git commit -m "commit message"
    git push heroku master

    • @loayakram4740
      @loayakram4740 4 года назад

      Thank you so much! I've been trying too many things and never succeeded you saved my life

  • @santiagopabloortiz6322
    @santiagopabloortiz6322 2 года назад

    Best developer youtuber ever

  • @adryanyudhatrisna1944
    @adryanyudhatrisna1944 6 лет назад +1

    Brad I love your videos and your course. I’m currently enrolling in your Modern JavaScript from the beginning course and I think it’s the best course in Udemy for JavaScript. I also want to learn Python but the courses out there just not as good and since I learn best from you I’m hoping you can create Python full stack courses maybe using Django or Flask. I notice Python also on the rise in 2018.
    Thank you brad

    • @thedumbfounds767
      @thedumbfounds767 6 лет назад +3

      If you're new to python, I can recommend sentdex's video series covering the python basics and intermediate features!

    • @adryanyudhatrisna1944
      @adryanyudhatrisna1944 6 лет назад +1

      Thank you for the info

  • @1patrickov
    @1patrickov 5 лет назад

    Excellent Series! I really appreciate how you do your best to explain what the code is doing as you write it. I found it very helpful. Just purchased your Udemy course using your link! Looking forward to starting it tommorrow!

  • @superbmood
    @superbmood 4 года назад +3

    For anyone getting a page with just "Cannot GET /", adding the following to server.js worked for me:
    var distDir = __dirname + "/dist/";
    app.use(express.static(distDir));

    • @jajajjajajajajajjjaj
      @jajajjajajajajajjjaj 3 года назад

      Thanks, how did you figured this out? can I get a reference material?

  • @garyharney3764
    @garyharney3764 5 лет назад

    Such a good feeling getting it deployed. Great stuff man, cheers for all the effort you put into your videos.

    • @kristopherwerlinder6446
      @kristopherwerlinder6446 5 лет назад

      How did you get the deployment to work? Was it easy? Did you do any extra steps apart from the video tutorial? I cannot get the deployment to work.

  • @tomatillo6140
    @tomatillo6140 6 лет назад

    For those of you who got problem with Postbuild, try "cd client && NPM_CONFIG_PRODUCTION=false npm install && npm run build" instead of --prefix client. Apparently it worked in the past and not so much now

  • @Fullflexno
    @Fullflexno 5 лет назад

    Thank you again Brad! Some of us really appreaciate the long content who goes deep. I know it doesent rack up the most views, but the diehard fans really enjoy it! Thanks from Norway!

  • @sakibarman6732
    @sakibarman6732 4 года назад

    Some tips before deployment:
    1. Safe Git Remove .git and .gitignore from client folder and then run git init in your root folder from bash. if you have already done it, remove them and again run git init.
    2. in server.js file, modify the mongoose.connect method by adding two properties. sample: connect(db, { useNewUrlParser: true, useUnifiedTopology: true })
    3. disable redux devtools in client/src/store.js

  • @travissmithoh
    @travissmithoh 6 лет назад +2

    Done. Thanks for a well-done overview. If anyone gets stuck on this step, double check this line:
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
    The dashes verse underscores held me up and the heroku site only said something like Error Not Found 404.

    • @reginaldosano6593
      @reginaldosano6593 6 лет назад

      Could you help me? Im getting this error when I - git push heroku master -
      ...........
      ...........
      added 1314 packages in 634.983s
      > client@0.1.0 build /tmp/build_4eebfe79cf9fffb6fe8992eb5df34a7e/client
      > react-scripts build
      Creating an optimized production build...
      Failed to compile.
      Module not found: Error: Can't resolve 'C:/Users/Regie/AppData/Local/Microsoft/TypeScript/2.9/node_modules/redux' in '/tmp/build_4eebfe79cf9fffb6fe8992eb5df34a7e/client/src'

      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! client@0.1.0 build: `react-scripts build`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the client@0.1.0 build script.
      ...........
      ...........

    • @NickHamilton88
      @NickHamilton88 6 лет назад

      Was stuck for like 10 min read your comment and realized I spelled "heroku-postbuild" wrong in that exact line. Thanks brotha

    • @travissmithoh
      @travissmithoh 6 лет назад

      Sorry it's taken so long. Have you checked the location?
      C:/Users/Regie/AppData/Local/Microsoft/TypeScript/2.9/node_modules/redux
      Being that this isn't a TypeScript course, I find the folder structure odd.

    • @reginaldosano6593
      @reginaldosano6593 6 лет назад

      Its ok now. i referrenced this path. It should have not been. Thank you.

  • @developerpranav
    @developerpranav 3 года назад

    Absolutely wonderful video! Loved it! Gonna use this for my current project!

  • @eric7758
    @eric7758 6 лет назад +1

    Brad you are doing more than what the newboston used to give us. guys! guys! guys!guys! brad is new MVP. yesssssss!!!

    • @Joshua-dl3ns
      @Joshua-dl3ns 6 лет назад

      thenewboston's channel is pretty dead. i wonder what happened to him, but i agree, brad is great and is the new MVP!

    • @eric7758
      @eric7758 6 лет назад

      @CodingBruh he got busy when he moved to New York

  • @ausar2379
    @ausar2379 4 года назад

    You are very good teacher. pleasure to meet you Sir.

  • @yoursshahnawaz
    @yoursshahnawaz 4 года назад +2

    Finallly, it's done. Thank you so much for the quality content ❤️

  • @chikanma5021
    @chikanma5021 2 года назад

    Thank you so much for the tutorials....God Bless

  • @Bebetter11111
    @Bebetter11111 2 года назад

    Awesome tutorials. I love them, the chuchuchu gets me every time lol

  • @hachij_
    @hachij_ 6 лет назад

    just finished this series and i gotta say u are the real MVP sir! thank you for all :)

  • @anwarhamoude2637
    @anwarhamoude2637 6 лет назад

    When I deploy my 1st MERN app it will be on Nginx with PM2, thanks in advance for jumping up my dev process.

  • @mkSlayer9
    @mkSlayer9 4 года назад

    Its deployed finally .. thank you so much !

  • @johngalantini6910
    @johngalantini6910 4 года назад

    Amazing video. So useful. This Heroku thingy is exactly what i've been looking for!!

  • @bradical8198
    @bradical8198 4 года назад

    Outstanding.. what I was looking for to get a concurrent app to production!

  • @marinakim2929
    @marinakim2929 3 года назад +1

    Oh come ooooon.... I've watched all previous videos from this playlist, looking at it like it was my last hope. I can't deploy my MERN app for almost one week now! And right at the end... I've done everything exactly the same, i mean exactly the same! And here again... push failed, pre-receive hook declined. Can somebody tell me what's up with the universe?

  • @tonycaterev4100
    @tonycaterev4100 4 года назад +5

    Great tutorial Bred, as usual.!
    The only thing that im struggling with is the git repo. As soon as i initialize a new repository for the MERN-project, the client folder "./client" wont be uploaded on "git push origin master".
    Thats also the reason why the deployment to heroku is currently not possible for me. The .gitignore file only contains the /node_modules. Did i miss something?

    • @tllong124
      @tllong124 4 года назад +3

      solution in comments => github.com/bradtraversy/mern_shopping_list/issues/7

    • @sparshsinghal7692
      @sparshsinghal7692 4 года назад

      @@tllong124 OMG!! I am so thankful you for this discussion

  • @Aoismusic
    @Aoismusic 5 лет назад +1

    Just figured out what was wrong with my deployment, everything was working but the deployed version was not able to get, add or delete. I forgot I had added an .env and forgot to include my environment variables in Heroku, took a good chunk of time for me to figure that one out. Just in case someone gets stuck with that as well just go to your app on heroku -> settings -> config vars and then just make sure they match up to your .env file.

  • @ThePolaris87
    @ThePolaris87 6 лет назад +1

    Hope you do add a login/authentication part to this series!!! Are there any other videos that anyone recommends to follow to implement one?

    • @nickstaresinic9933
      @nickstaresinic9933 6 лет назад +1

      See his Udemy course: MERN Stack Front To Back: Full Stack React, Redux & Node.js
      I've almost completed it, and it's super. He has the same pace, the same level of detail throughout, and thoroughly covers login/authentication.
      For me, this 8-video series has been a very useful supplement to that course.

  • @jAyAntswAmi
    @jAyAntswAmi 5 лет назад +3

    The API Calls that we are making using axios were pointed to "localhost:5000" which is our proxy set in the client/package.json. How is that after deployment, it is working correctly? The PORT we mentioned in the proxy is still 5000.

    • @zachwhite8054
      @zachwhite8054 5 лет назад +2

      The process.env.PORT (second to last line of your 'server.js' file) detects whatever port that Heroku has your app running on and uses that for your backend proxy instead

    • @jAyAntswAmi
      @jAyAntswAmi 5 лет назад

      @@zachwhite8054 Thanks Zach it helps. Let me know if you have any link to a resource where I can read further.

    • @zachwhite8054
      @zachwhite8054 5 лет назад

      @@jAyAntswAmi No problem. stackoverflow.com/questions/18864677/what-is-process-env-port-in-node-js

    • @WinterMute2051
      @WinterMute2051 4 года назад

      @@zachwhite8054 Hello, I have this set up like the tutorial, but when live on heroku it is still trying to access through localhost:5000/api/... Any idea why that would be?

    • @zachwhite8054
      @zachwhite8054 4 года назад

      @@WinterMute2051 Make sure when deployed that your requested routes look like axios.get('/api/example') and not axios.get('http:localhost:5000/api/example') and that you are using a proxy in your script in your front end package.json . Also in the past I have benefited from adding a "Procfile" for Heroku to use. Look into that as well

  • @sammas533
    @sammas533 4 года назад

    Just to mention: yesterday, after i deployed the app, there were no items in the list so i added a new ip allowing access from everywhere but it didn't make any changes directly. I thought my app was broken but the morning it works correctly! So it can take some time to make the update.

  • @AbhishekSharma-kl2bm
    @AbhishekSharma-kl2bm 6 лет назад

    Very nice course. Explained very clearly

  • @lykalabrada
    @lykalabrada 6 лет назад +1

    Another successful series!! Thank you so much for being the best teacher Sir Brad :D

  • @JCart2024
    @JCart2024 5 лет назад

    You're the man Brian.

  • @dolidius
    @dolidius 6 лет назад

    I really liked this series and I hope you will add some autthentication stuff soon.

  •  5 лет назад

    Great series, Brad. As always. Thanks for your guidance and hard work dedicating your precious time to teach us. I hope to pay it back soon. :)

  • @WinterMute2051
    @WinterMute2051 4 года назад +1

    I have deployed to Heroku fine. But the front end is still attempting to contact the localhost:5000/api/... instead of using heroku... How can I fix this?

  • @00saad50
    @00saad50 5 лет назад

    LMAO "I know people will spam it and get my mLab account cancelled" - the words of an Internet veteran. Great video series, definitely gave me a good idea of what it's like to build and and deploy a fullstack app.

  • @akshittrikha2297
    @akshittrikha2297 3 года назад

    Thanks a lot for this awesome series.

  • @OfficialChoiceTV
    @OfficialChoiceTV 6 лет назад +2

    Thanks, Brad! Great stuff as always.

  • @mistah_mojo
    @mistah_mojo 2 года назад

    I don't know why but hearing you say "weird ass names" is crackin me up LMAOOOO

  • @bretocameron
    @bretocameron 5 лет назад

    If you use Windows, you'll probably get an error when trying to create the "heroku-postbuild" script.
    To get around this, install the cross-env module (npm i cross-env) and put the cross-env keyword at the beginning of the script, like this:
    "heroku-postbuild": "cross-env NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"

  • @pjguitar15
    @pjguitar15 3 года назад +2

    Am I the only one stucked here with deployment? I get Build failed error and I tried stack overflow solutions and went to heroku support, but still can't :(

    • @substantialprogress37
      @substantialprogress37 3 года назад

      Same issue here, giving me something to do with fsevents and bad platform

  • @sureshherath496
    @sureshherath496 6 лет назад

    This is a sugestions for all the tutorial. If you can record all the resources what you are use for the tutorial and common errors what you get and what is the way you are going to fix those errors it will be wary helpful. This is a suggestion if you can do it. It will make real developer after watch your tutorials. Some time I'm confusing how did you fixed that. And where did you from get that resource.

  • @FamousWolfe
    @FamousWolfe 6 лет назад

    If anyone is struggling to deploy to Heroku:
    1. In Heroku dashboard, click on 'Resources' then look for a section that says 'Add Ons'. Type "mLab" (sans quotes) and it should locate the mLab MongoDB addon. Enable it, it should say something about sandbox (it's free).
    2. In your terminal, head over to your app at the main level (don't go into /client or /src or anything) and reinstall all your dependencies using npm i --save [name of dependency minus brackets]
    (If you carefully read the error output you get when you try to push to Heroku, it should say something like "Error: can't resolve 'axios'..." or whatever dependency is causing the issue, just reinstall that dependency using npm i --save [name of dependency here] that causing the error message and try pushing to Heroku again).
    3. If the error persists, carefully read the error output and see if it's throwing a different dependency name. Just install the one that's causing an error like I said. Eventually you'll get through it all and the build will succeed.
    3. ??? Profit???

  • @leerenae313
    @leerenae313 3 года назад

    Ahh so greatful for this channel!

  • @xaviersalvatore3202
    @xaviersalvatore3202 6 лет назад

    After doing some many tutorials where the instructor would speed through the content it was great to find a teacher taking the time to explain every step of the process !
    Just one question : I managed to deploy the app to heroku but for some reason I can only look at it on my desktop and I can't look at it on my iPhone is it normal ?
    Thanks Brad !

    • @arroyoruy
      @arroyoruy 6 лет назад +3

      In my store I changed the createstore to: ->
      const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
      const store = createStore(rootReducer, initialState, composeEnhancers(applyMiddleware(...middleware)));
      and now it works on phone, firefox, IE, etc...

    • @matsredman7640
      @matsredman7640 5 лет назад

      @@arroyoruy Thank You! This worked for me also!

  • @imdeadshot3632
    @imdeadshot3632 4 года назад

    works in 2020! Thanks a ton!

  • @bondeveloper1024
    @bondeveloper1024 3 года назад

    This was super helpful!!!

  • @libertydaniel6366
    @libertydaniel6366 3 года назад +2

    Cannot GET / error when deploying. Anyone knows the problem

  • @annez8598
    @annez8598 6 лет назад

    Excellent tutorial series! Many thanks!

  • @kaypakaipa8559
    @kaypakaipa8559 5 лет назад +2

    Golden Angel. I can now put Fullstack developer in my Resume😂

  • @TheMathur13
    @TheMathur13 5 лет назад +2

    Hi Brad,The deployment is working perfectly on desktop,but when I tried accessing the same url on a mobile device,The ReactDom is not rendering the "root" div.
    Although the index.html is rendering (I tried adding a for checking - which is visible on the mobile)
    Any tips?

    • @valentinoyoutub
      @valentinoyoutub 5 лет назад

      I have the same issue @Traversy Media

    • @thisisdomino
      @thisisdomino 5 лет назад

      It's an issue with the Redux Dev Tools extension in store.js. See this page: github.com/bradtraversy/mern_shopping_list/issues/6

  • @salimdellali1814
    @salimdellali1814 3 года назад

    For the people getting a blank webpage after deploying to heroku,
    Check the Dev tools and the the console : if you see something like :
    TypeError: Cannot read property 'apply' of undefined
    it's probably related to the REDUX EXTENSION lines of code in client/src/store.js file,
    I fixed the problem by removing the :
    compose(
    applyMiddleware(...middleware),
    window._REDUX_DEVTOOLS_EXTENSION_ && window.__REDUX_DEVTOOLS_EXTENSION__()
    )
    and just putting :
    applyMiddleware(...middleware)
    Hope this helps

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 лет назад

    Thank u for this awesome series Brad, next series on MEVN

  • @nimeshprakash
    @nimeshprakash 5 лет назад +2

    on deleting "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client" , my app got deployed in heroku but on opening the app it says 'not found'.....please help

    • @adnanaslam9604
      @adnanaslam9604 5 лет назад +1

      i m also getting same error

    • @kevinrodriguez7833
      @kevinrodriguez7833 5 лет назад +1

      @@adnanaslam9604 Did anyone fix it because I have the same error.

  • @alexthomas1137
    @alexthomas1137 6 лет назад +3

    I can see the app fully deployed and working on desktop but nothing showing up on Safari. Has anyone else had this issue?

  • @algcargos4104
    @algcargos4104 3 года назад

    If react app is too large. Won't there be any perfomance issue? As it looks so static. Serving that much static data in each request should take a lot of time.

  • @JassarDev
    @JassarDev 4 года назад

    Remember the proxy line in client > package.json?
    Is this ignored in heroku? just trying to make sense of this.
    Thank you very much.

  • @kjn5991
    @kjn5991 4 года назад

    Do not create the app through Heroku CLI if you want better name for the app.
    Create the app through the Heroku website and it gives you option to name it.
    (I think it is available as a command line option flag in CLI too, though).

    • @kjn5991
      @kjn5991 4 года назад

      Also, you can create a config var in Heroku which holds the MongoDB connection string, that way you don't have to expose the string in code.
      Do something like this:
      const db = process.env.MONGO_URI || require("./config/keys").mongoURI;

  • @thuanhoangnhat2350
    @thuanhoangnhat2350 5 лет назад

    thanks teacher Brad Traversy very much from Viet Nam

  • @kimberlyvillarmente8239
    @kimberlyvillarmente8239 4 года назад

    thank you so much !!! It works, I am so very happy

  • @getrekt1386
    @getrekt1386 6 лет назад

    thanks for the full course

  • @olvnat5130
    @olvnat5130 5 лет назад

    You da man Traversy.

  • @АбайРеушенов
    @АбайРеушенов 3 года назад

    Thank you!

  • @kimshares1487
    @kimshares1487 2 года назад

    NB: add your laptops npm version in the server package.json file. for example:
    "npm": "8.1.1"
    at the engines part.

  • @Dev3ATX
    @Dev3ATX 5 лет назад

    Thanks Buddy. Nice intro to MERN.

  • @aidarousjibril6323
    @aidarousjibril6323 6 лет назад +7

    i can't deploy it to the heroku, it says 'heroku push failed', how to solve this problem
    guys

    • @codingmechanic8954
      @codingmechanic8954 5 лет назад +3

      not sure if you're having the exact same issues I did but I had to delete my .git files from the client folder. This may help: github.com/bradtraversy/mern_shopping_list/issues/7

    • @JasperEjoc
      @JasperEjoc 5 лет назад +2

      @@codingmechanic8954 thanks, I've been troubleshooting for almost an hour. You are right, deleting the .git files inside client folder solves the issue.

  • @mattchristensen2403
    @mattchristensen2403 5 лет назад +1

    Thanks Brad, well done. It all worked well for me even the herokuapp deployment, It works well on the desktop. Except when I try to get to the app via my phone's chrome application it doesn't show anything....any ideas what I may be missing?

    • @MrKentiba
      @MrKentiba 5 лет назад

      The issue is the redux devtool . you browser need to have it in order to run the app . the soultion can be found here
      stackoverflow.com/questions/50505805/heroku-app-only-works-on-chrome-desktop-react-js-application

  • @squadbustersgamings
    @squadbustersgamings 4 года назад +2

    Nice tutorial. I download the code and compile it but I have an issue with GET and POST, which is POST localhost:3000/api/auth/register 400 (Bad Request). Any idea why?

  • @devianttt94
    @devianttt94 3 года назад

    Hi. When I tried to upload my MERN app after following every step you did, it gave me a white screen. But when I run it locally, it works. Can you please help me out?

  • @daniilchistyakov3087
    @daniilchistyakov3087 3 года назад

    Can you make a video using Vercel? I spent couple of days and couldn't find any solution.

  • @deepdivedevs100
    @deepdivedevs100 3 года назад

    it always says _command build not found_ but only when i run *git push heroku master**, if i simply run *heroku-postbuild* locally, there is no error, what shoud i do?

  • @arminydy
    @arminydy 6 лет назад

    Brad, you are awesome!

  • @sunilzwengineer
    @sunilzwengineer 3 года назад

    That was really awesome video deploying MERN App on Heroku. I really appreciate if u can make a video on Deploying the MERN on AWS . Or atleast the Steps to do deployment.
    As there no Video on YT which adheres to industry standards.That would really the MERN Develeopers..Thanks in Advance.

  • @varungupta9792
    @varungupta9792 6 лет назад

    Thanks for this amazing series, Brad. Hey, Can you please add a video on react-router-dom..??

  • @Seb16291629
    @Seb16291629 3 года назад

    How to deploy when using typescript in front end ? Would you use tsc or webpack + babel are needed ?

  • @kendallmiyakawa3092
    @kendallmiyakawa3092 3 года назад

    If you are getting a 503 Service Unavailable error on your deployed Heroku app when the front end makes requests to the back end, try "npm install -g serve" in your terminal and repeat the Heroku build process. I had never installed the serve package globally and so it seems like my back end couldn't be served up for the front end to make calls to.

  • @parashuramakulakarni5073
    @parashuramakulakarni5073 6 лет назад +2

    Brand! Came back like a bullet train speed 😁😀

  • @jimothyus
    @jimothyus 6 лет назад

    beautiful videos brad

  • @Abdo-yy4ep
    @Abdo-yy4ep 5 лет назад

    One of my favorite videos on the entire internet

  • @prakarshgupta
    @prakarshgupta Год назад

    Hey Brad, Since heroku is now paid, how can we host the same app on firebase or vercel or netlify. I couldn't find a way to upload a project with similar skeleton. If possible, can you make a video tutorial for that

  • @Ibrahim_usman
    @Ibrahim_usman 6 лет назад

    I want to get the full tutorial because I could follow this really well, but I'm new to Javascript so I'm not sure if I should just jump into it. I know Java and PHP so is that background enough for me to just jump into it, or must I learn Javascript first? or can I learn MERN then brush up on my JS later?

  • @ajricherson1099
    @ajricherson1099 5 лет назад

    In case anybody was getting an error in VSCode like 'heroku is not a recognized term', try restarting VS. If that doesn't work, verify you installed it by running the same command in vanilla PowerShell.

  • @beardninja5029
    @beardninja5029 6 лет назад

    Are you considering getting into blockchain development with Node.js, Truffle etc. ?

  • @MiserableDuck95
    @MiserableDuck95 5 лет назад

    Maybe a dumb question, but how does the server get started automatically after it's been deployed to Heroku? It just automatically works?

  • @beardninja5029
    @beardninja5029 6 лет назад

    Just finished the series! God Bless you Brad

  • @adarshrathi4038
    @adarshrathi4038 3 года назад

    Heroku only displaying the backend of MERN app. How can I fix this?