Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Echo Service Examples

Examples of using Echo Service via Docker image and NPM package.

🐳 Docker Usage

Using Container

# Start container
npm run start:docker

# Stop container
npm run stop:docker

Using Docker Compose

# Start services
npm run start:docker-compose

# View logs
npm run logs:docker-compose

# Stop services
npm run stop:docker-compose

🎯 CLI Usage

Using the package as a command-line tool:

npm run start:cli

📦 Library Usage

Using the package as a library in your code:

npm run start:lib

🧪 Testing the Examples

Each example runs on a different port to avoid conflicts.

Docker Example (Port 3003)

curl http://localhost:3003/health
curl http://localhost:3003/echo

CLI Example (Port 3002)

curl http://localhost:3002/health
curl http://localhost:3002/echo

Library Example (Port 3001)

curl http://localhost:3001/health
curl http://localhost:3001/echo

⚠️ Troubleshooting

Port Already in Use

# Check what's using the port
lsof -i :<port_number>

# Kill the process
kill -9 <PID>

Docker on ARM-based machines (Apple Silicon, etc.)

docker pull --platform linux/amd64 junjiewu0/echo-service
docker run --platform linux/amd64 -p 3003:3000 junjiewu0/echo-service