POST /tasks endpoint. Invalid JSON stops at the contract boundary; accepted input reaches a typed handler.
Prerequisites
- Go 1.27 or later
- A Go module you can run locally
Install HTTPAPI
Define and serve the endpoint
Createmain.go:
Run and call it
Start the service:What to add next
- Replace the example map with a declared response shape.
- Add authorization, timeouts, limits, and operation metadata in the endpoint contract.
- Install your authentication and persistence adapters through server wiring.