This project is a sample NodeJS API with Typescript, and is being used to demonstrate the process of developing and deploying an application to production.
Server: Node, Express, Typescript, Jest
Infrastructure-as-Code: Terragrunt, Terraform
CI/CD: Github Actions
Cloud: AWS
Cloud Resources: ECS, ECR, Load Balancers, VPC, Route53, Cloudwatch, IAM
Clone the project
git clone https://github.com/sonikro/nodejs-api-aws-terraform-gha.git
Go to the project directory
cd nodejs-api-aws-terraform-gha
Install dependencies
yarn
Start the server
yarn start
To run this project, you will need to add the following environment variables to your .env file
PORT
| Default to 8080
To run tests, run the following command
yarn test
GET /customer
POST /customer
{
"id": "1",
"email": "some@email.com",
"name": "Some name"
}
Parameter | Type | Description |
---|---|---|
body |
json |
Customer being added |
To connect your runner to your AWS Account, you need to setup an OIDC in AWS to allow your repository to assume a specific role. For more information, see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
⚠️ Deploying this to your AWS Account will incur costs: