Zero to Production Node.js on Amazon Web Services NPM Scripts & Elastic Beanstalk
This course has been updated! We now recommend you take the AWS for Front-End Engineers (ft. S3, Cloudfront & Route 53) course.
Transcript from the "NPM Scripts & Elastic Beanstalk" Lesson
>> Kevin Whinnery: I mentioned this before but the NPM scripts have a special relationship with Elastic Beanstalk which is gonna be our deployment environment here this afternoon. The three NPM scripts that Elastic Beanstalk cares about is NPM start, which is going to be the command that's run to actually start up the web process that's gonna serve requests on your EC2 instance.
[00:00:30] Prestart, which is the command to run prior to the start. And poststart, which as you might imagine, is the command run after the start command. So wherever we have an NPM start is going to be the way that Elastic Beanstalk launches our node process. In our example, we're just launching our server process with the node command.
[00:00:53] But you might imagine we could do other things like start it with a process manager like PM2 or Nodemon or Forever or something like that rather than just using node directly. So this is the opportunity we have to kind of configure how our node process is run.