Demonstrates pactown’s ability to orchestrate services written in different programming languages.
┌─────────────────┐
│ Go Gateway │ :8080
│ (net/http) │
└────────┬────────┘
│
┌──────────────┴──────────────┐
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Node.js API │ │ Python ML │
│ :3000 │──────────▶│ :8010 │
│ (Express) │ │ (FastAPI) │
└─────────────────┘ └─────────────────┘
| Service | Port | Language | Framework | Description |
|---|---|---|---|---|
| Go Gateway | 8080 | Go | net/http | API gateway, request routing |
| Node.js API | 3000 | JavaScript | Express | REST API, proxies to ML |
| Python ML | 8010 | Python | FastAPI | ML prediction service |
# Start all services
cd examples/microservices
pactown up saas.pactown.yaml
# Test the gateway
curl http://localhost:8080/health
curl http://localhost:8080/status
GET /health – Gateway healthGET /status – Aggregated status of all servicesGET /ml/* – Proxied to Python MLGET /api/* – Proxied to Node.js APIGET /health – Service healthGET /api/items – List itemsPOST /api/items – Create itemPOST /api/predict – Proxy to ML serviceGET /health – Service healthGET /model/info – Model informationPOST /predict – Make prediction# Get ML model info via gateway
curl http://localhost:8080/ml/model/info
# Make prediction via gateway
curl -X POST http://localhost:8080/ml/predict \
-H "Content-Type: application/json" \
-d '{"features": [1.0, 2.0, 3.0, 4.0]}'
# Create item via gateway
curl -X POST http://localhost:8080/api/items \
-H "Content-Type: application/json" \
-d '{"name": "test", "value": 42}'
# List items
curl http://localhost:8080/api/items
microservices/
├── saas.pactown.yaml
├── README.md
└── services/
├── python-ml/
│ └── README.md
├── node-api/
│ └── README.md
└── go-gateway/
└── README.md