Sample TypeScript+Express demo with Jest and AWS CodeBuild specs for testing and ECR image creation.
# Install dependencies
npm install
# Start typescript server (ts-node)
npm run start
# Build JS
npm run build
# Execute tests and generate coverage
npm run test
npm run coverage
# Generate Docker image
docker build --no-cache -t typescript-codebuild-demo .
# Run container in background
docker run --rm -d -p 8080:8080 --name typescript-codebuild-demo typescript-codebuild-demo
You can access local container running on http://localhost:8080
{
"success": true,
"message": "Hello World"
}
docker stop typescript-codebuild-demo