In this post, I will share how to set up a continuous integration and continuous delivery (CI/CD) pipeline on AWS for API gateway. The following AWS services will be used:
Cloudformation allows you to model your entire infrastructure and application resources
CodePipeline is a continuous delivery service
CodeCommit is a version control service
CodeBuild is a fully managed build service in the cloud
Simple Storage Service (Amazon S3) is storage for the Internet
API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs
Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
npm
npm is the default package manager for the JavaScript runtime environment Node.js
1 2 3 4 5 6 7 8 9
# Install package npm install package-name
# Check outdated packages npm outpdated
# Run arbitrary package scripts in package.json npm run
nodemon
nodemon will read the package.json for the main property
nodemon will also search for the scripts.start property in package.json
Documentation
exports / require
module.exports is used for defining what a module exports and makes available through require() (1) The exports variable is available within a module’s file-level scope, and is assigned the value of module.exports before the module is evaluated.
(2) However, be aware that like any variable, if a new value is assigned to exports, it is no longer bound to module.exports
nvm install node # “node” is an alias for the latest version
npm install installs dependencies into the node_modules/ directory npm run build does nothing unless you specify what “build” does in your package.json file