Examples of using Echo Service via Docker image and NPM package.
# Start container
npm run start:docker
# Stop container
npm run stop:docker
# Start services
npm run start:docker-compose
# View logs
npm run logs:docker-compose
# Stop services
npm run stop:docker-compose
Using the package as a command-line tool:
npm run start:cli
Using the package as a library in your code:
npm run start:lib
Each example runs on a different port to avoid conflicts.
curl http://localhost:3003/health
curl http://localhost:3003/echo
curl http://localhost:3002/health
curl http://localhost:3002/echo
curl http://localhost:3001/health
curl http://localhost:3001/echo
# Check what's using the port
lsof -i :<port_number>
# Kill the process
kill -9 <PID>
docker pull --platform linux/amd64 junjiewu0/echo-service
docker run --platform linux/amd64 -p 3003:3000 junjiewu0/echo-service