Documentation
¶
Overview ¶
Command notes is a small JSON API built with Anetos's HTTP layer: routing, named routes, typed handlers with binding and validation, and error responses. Notes are kept in memory.
APP_ENV=development HTTP_ADDR=:8080 go run ./examples/notes
curl -s localhost:8080/notes -H 'Content-Type: application/json' -d '{"title":"Hello","body":"First note","tags":["intro"]}'
curl -s localhost:8080/notes -H 'Content-Type: application/json' -d '{"title":"","tags":["a","a"]}' # 422
curl -s localhost:8080/notes?limit=10
curl -s localhost:8080/notes/1
curl -s -X DELETE localhost:8080/notes/1
Click to show internal directories.
Click to hide internal directories.