/typescript-codebuild-demo

Sample TypeScript+Express demo with Jest tests & AWS CodeBuild specs

Primary LanguageTypeScriptMIT LicenseMIT

TypeScript CodeBuild Demo

made-with-typescript Maintenance

Sample TypeScript+Express demo with Jest and AWS CodeBuild specs for testing and ECR image creation.

Installation

# 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

Build Docker image

# 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

Access service

You can access local container running on http://localhost:8080

{
  "success": true,
  "message": "Hello World"
}

Stop and remove container

docker stop typescript-codebuild-demo