TypeScript Basic Webserver
Summary
A minimal Express.js web server written in TypeScript with hot reload via nodemon, Docker containerization, Kubernetes deployment manifests, and GitHub Actions CI/CD workflow.
A minimal Express.js web server written in TypeScript. Displays "Hello World" and demonstrates deployment to Kubernetes via ArgoCD and GitHub Actions.
Quick Start
-
Update your terminal (tools were installed):
source ~/.bashrc -
Install dependencies and run:
npm install
npm run dev -
Open in browser: http://localhost:3000
The server auto-reloads on file changes via nodemon.
Prerequisites
Development tools are installed automatically by the devcontainer.
If you need to reinstall, run: dev-setup
Project Structure
After installation, your project contains:
├── app/
│ └── index.ts # Express server with Hello World
├── manifests/
│ ├── deployment.yaml # K8s Deployment + Service
│ └── kustomization.yaml # ArgoCD configuration
├── .github/
│ └── workflows/
│ └── urbalurba-build-and-push.yaml # CI/CD pipeline
├── Dockerfile # Container build
├── package.json # Node.js dependencies
├── tsconfig.json # TypeScript configuration
├── TEMPLATE_INFO # Template metadata
└── README-typescript-basic-webserver.md # This file
Development
- Edit
app/index.ts— the main Express server - Changes auto-reload via nodemon (
npm run dev) - The
/endpoint returns "Hello World"
Docker Build
docker build -t typescript-basic-webserver .
docker run -p 3000:3000 typescript-basic-webserver
Kubernetes Deployment
kubectl apply -k manifests/
The app will be accessible at http://<app-name>.localhost after ArgoCD registration.
CI/CD
The GitHub Actions workflow automatically builds and pushes the Docker image to GitHub Container Registry when changes are pushed to the main branch.