Sample crud operation using Golang and MySql
“[s1s1ty/go-mysql-crud] is being sponsored by the following tool; please help to support us by taking a look and signing up to a free trial” <img src="https://images.gitads.io/s1s1ty/go-mysql-crud/" alt="GitAds"/>
- Path :
/posts
- Method:
GET
- Response:
200
- Path :
/posts
- Method:
POST
- Fields:
title, content
- Response:
201
- Path :
/posts/{id}
- Method:
GET
- Response:
200
- Path :
/posts/{id}
- Method:
PUT
- Fields:
title, content
- Response:
200
- Path :
/posts/{id}
- Method:
DELETE
- Response:
204
First clone the repo then go to go-mysql-crud folder. After that build your image and run by docker. Make sure you have docker in your machine.
git clone https://github.com/s1s1ty/go-mysql-crud.git
cd go-mysql-crud
chmod +x run.sh
./run.sh
docker-compose up