go-blog-api is a REST API project for create, read, update and delete posts (CRUD operations). It uses a Go backend and a Mongo database for storing the data. Also can be run with Docker.
http://localhost:8080/
git clone https://github.com/Luiggy102/go-blog-api.git
cd go-blog-api
go run main.go
git clone https://github.com/Luiggy102/go-blog-api.git
cd go-blog-api
docker compose up
GET /
: Shows a welcome message
GET /posts
: List the firsts posts
GET /posts/{id}
: Get the post info by the post ID
GET /posts?page=2
: Pagination feature to see posts
POST /posts
: Insert a post in JSON format
Example:
{
"post_content": "sample text"
}
PUT /posts/{id}
: Update the post using the post ID, receive a JSON with the content to be updated
{
"post_content": "update text"
}
DELETE /posts/{id}
: Delete the post using the post ID