How to keep your NODE Express API listening on a AWS EC2 instance

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
sure follow along the last video into how to deploy a node express api to an ec2 instance so this is the follow-up video um now that you have the ec2 instance running and you have your api downloaded um into your ec2 instance and it's running what happens when you get out of and you stop the port from running so that um that will stop your api from running all together so if you even try it here um if you try it with the public id address you go into like a new tab here and then we try it with the fordify 2001 and you see it's stopped so it's not it's not working right so that's why we installed that tool um pm2 we installed pm2 so that we could um say hey bm2 start um our index js file [Music] and always just have it running at all times so as i do that code there you see that pn2 pm2 list will give me everything that is running and it's listening into that api so you see now my browser even refreshed and now my api is running so the good thing about this is that i can exit out of it and my api is still running whereas if i was just to um i'm going to connect again to my ssh um ubuntu server and i could go into pm2 list and i could see it running still but i could do pm2 stop 0 for the id 0 and then it will stop in my browser i could refresh it and now stopped okay so that's that's why we use pm2 so to keeps the index h the index js file running at all times okay so we do pm2 um start um index well we're inside of the root so i'm gonna go inside of our not express so we could do is say vm2 node express index js started off like that um oh i didn't do it start so bm2 start node and xjs and then with the with the start command it's going to have that um pm2 always be um listening into that um and running that index so now my api is running back again okay i know this was a short one but um i needed to um add it to our last video so again just if you have any comments just put them on the description there this is the part two of of that um node api into ec2 instance if you have any questions put them in the comments and um give it a thumbs up if you liked it thanks guys
Info
Channel: JonathanSanchez
Views: 1,673
Rating: undefined out of 5
Keywords:
Id: p239HLbuMTQ
Channel Id: undefined
Length: 3min 19sec (199 seconds)
Published: Tue Sep 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.