Node.js Deploy to Amazon Web Services (AWS) Tutorial (Elastic Beanstalk, Express, Git, CI/CD)

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


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

Caleb I know it's 2 years later but thanks for this video bro. You've always had down to earth explanations that people from all learning styles can understand.

robertgioeli
Автор

If you're watching this, here's whats going on with the 502 error:

Don't make a new variable in elastic beanstalk called "port"! Amazon already sets the environment variable for you...but they set the variable "PORT", not "port". So in your app.js code change "process.env.port" to "process.env.PORT" and things will work properly...

Except they won't. For a lot of you, you're still getting a 502 error. But that isn't because of the port; your application simply can't start, with or without AWS. The issue is that AWS is trying to run a command like "npm start" but it isnt working. On your local machine navigate to the project directory in your terminal and try "npm start". If that fails, then you've found the problem. Here's how you fix it...

npm start, by default, looks for a file called "server.js", not "app.js" like he told you to name your file. There are two solutions. The first is to change the settings in your project to make it look for "app.js" instead. The second solution is to simply change "app.js" file name to "server.js". I recommend the second option.

Repush after making these changes and you should be good to go.

ThatsPety
Автор

Almost 3 years later, and this is the best tutorial i've ever seen. Thank you so much

AydinCodes
Автор

You, Sir, are a true hero. Not the hero we deserved, but the hero we needed.

sebastianraab
Автор

I like that you showed even the errors you encountered so that it can help us debug/fix it. Thank you buddy! I will slap the "like" button and subscribe too!

cliffvbajo
Автор

I am halfway to the video, the way you summed up everything. its marvellous and big thank you

nishantsethi
Автор

For anyone watching and still getting a 502 error make sure to define a "start" script in your package.json, in my case I did:

"start":"node app.js"

Also make sure to define your port in env config and look in the logs to see which port your environment is running on

Chrrxs
Автор

>"502 Bad Gateway, yeah!... so that's the end of the tutorial."
hahahaha

richie-bonilla
Автор

Yes caleb we are very interested on a tutorial on how to use mongo db with this. pls do

jonjon
Автор

Thanks a lot Caleb!
Love how you celebrate your failures/errors. That's the best attitude

josephwong
Автор

Man just what I needed! Thanks!

If any of you guys is having trouble trying to connect to a RDS Database from an Elastic Beanstalk Node.JS app check the SECURITY GROUP POLICY of the DB to accept traffic from Custom > Your Beanstalk Instance (this must be done manually) . Also check if you have a NPM RUN script in your package.json (it wont work otherwise) and your ENVIRONMENT VARIABLES set in the Beanstalk environment section.

SrRunsis
Автор

instead of adding port as env variable you should use PORT(all caps) in your code for it to work also it is a good practice to have environment variables in all caps

jaydave
Автор

a good tutorial on how to deploy with aws. THANK YOU!!!!

omerlev
Автор

This was exactly what I needed to get my app up and running. Thank you for a down-to-earth, straightforward tutorial

alexandermichaud
Автор

Bloomin eck Caleb - nicely done. I needed a very simple start for my first was deploy - I feel like I learned all the steps waaay beyond this and was missing this critical step. Subscribed. Thank you.

nicholasdaniel-richards
Автор

I had a local env with mongoDB/atlas but it was impossible to find a tutorial on how to bring everything live. Your tutorial nailed it thanks!

noobminer
Автор

Hey man thanks for this video, I used to watch you alot during my senior year of university for DBMS. Glad to see that 3 years later you're still producing content that is completely relevant to me haha

jameschhun
Автор

So good. Thank you. This worked great for me (had been trying to figure it out for a while). Site up and going, until it's time to hit the DB on Atlas! Would be great to see the Mongo DB part you were going to do.

adrianfittolani
Автор

The best tutorial on deployment of node project on AWS! thanks

sohailb
Автор

Cool Caleb. Tip for beginners, AWS EB considers app.js as default start script. If different, explicitly mention in package.json. "start": "src/app-main.js"

visvm