module
0.0.0-20240607192342-f3dc9117d023
Repository: https://github.com/ahmedyasserm/goapi.git
Documentation: pkg.go.dev
# README
GO API
This is a simple CRUD API for maintaining a list of posts. It is built using Golang and PostgreSql.
Installation
- Clone the repository and navigate to the directory
git clone https://github.com/ahmedYasserM/goapi.git
cd goapi
- build the docker image of the api
docker compose build
- Run the docker containers
docker compose up -d
- The API will be available at
http://localhost:7000
API Endpoints
- GET
/posts
- Get all posts - GET
/posts/{id}
- Get a single post - POST
/posts
- Create a new post - PATCH
/posts/{id}
- Update a post - DELETE
/posts/{id}
- Delete a post
API Payload
- POST
/posts
- Create a new post
{
"author": "Post Title",
"content": "Post Content"
}
- PATCH
/posts/{id}
- Update a post
{
"author": "Post Title",
"content": "Post Content"
}
or
{
"author": "Post Title"
}
or
{
"content": "Post Content"
}
# Packages
No description provided by the author