This is a "Drive Test" on Golang to learn a bit about the language and have fun programming.
The solution is pretty simple, a REST API with a CRUD logic on Post. There's 2 rules for the Post entity:
- Every post title must have at least 5 characters
- Every post body must have at least 10 characters
The previous version of this project: v0.1.0.
Was one of the first Golang projects I've ever made, I decided to update the project to follow better practices and to keep the repository clean
go run cmd/main.go
This project is created by cloning the template from gosk.
curl http://localhost:8080
curl http://localhost:8080/:id
Posts must have at least 5 characters for the title and 10 characters for the body
curl -d '{"title": "Hello World!", "body": "This is a test on the Post Creation"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8080
Posts must have at least 5 characters for the title and 10 characters for the body
curl -d '{"title": "This is an updated post!", "body": "Lorem Ipsum for the updated post"}' \
-H "Content-Type: application/json" \
-X PUT http://localhost:8080/:id
curl -X DELETE http://localhost:8080/:id