Categorygithub.com/ahmedYasserM/goapi
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

  1. Clone the repository and navigate to the directory
git clone https://github.com/ahmedYasserM/goapi.git
cd goapi
  1. build the docker image of the api
docker compose build
  1. Run the docker containers
docker compose up -d
  1. The API will be available at http://localhost:7000

API Endpoints

  1. GET /posts - Get all posts
  2. GET /posts/{id} - Get a single post
  3. POST /posts - Create a new post
  4. PATCH /posts/{id} - Update a post
  5. DELETE /posts/{id} - Delete a post

API Payload

  1. POST /posts - Create a new post
{
  "author": "Post Title",
  "content": "Post Content"
}
  1. 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