ServicesTemplate Service
Getting started
Run the template service locally with Make, Swagger, and curl.
Prerequisites
Follow Local development: make dev-up and make migrate.
Start the API
make dev-template- API: localhost:8081
- Swagger UI: localhost:8081/api-docs
- Database:
postgres://template:template@localhost:5432/template
Authorization is not wired in the template service yet — endpoints are open aside from
Idempotency-Key on writes.
Create a domain1 record
curl -s -X POST localhost:8081/v1/domain1 \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{"data":{"value":"hello"}}' | jqGet by id
curl -s localhost:8081/v1/domain1/{id} | jqDomain2 uses the same shape at /v1/domain2.
Generate OpenAPI
go run ./services/template/cmd/api -openapi > /tmp/template-openapi.yamlThe checked-in spec is services/template/openapi.yaml.