zsomborjoel / go-crud

Sample crud with gin and gorm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-crud

Sample crud with gin and gorm

How to run the application

  1. On linux just go into the app directory cmd/go-crud
  2. Run like this ./go-crud

Insert:

curl -X POST localhost:3000/api/posts -H 'Content-Type: application/json' -d '{"Title":"newtitle","Body":"newbody"}'

Update:

curl -X POST localhost:3000/api/posts/1 -H 'Content-Type: application/json' -d '{"Title":"updatetitle","Body":"updatebody"}'

Delete:

curl -X DELETE localhost:3000/api/posts/1

Get One:

curl localhost:3000/api/posts/1

Get All:

curl localhost:3000/api/posts

About

Sample crud with gin and gorm

License:The Unlicense


Languages

Language:Go 85.9%Language:Shell 14.1%