Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

munierujp/echo-gorm-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echo-gorm-example

Example of Echo + GORM

Usage

$ cd db
$ docker-compose up -d
$ cd ../
$ go run server.go

API is available on localhost:1323

Example

Create

$ curl -X POST -H 'Content-Type: application/json' -d '{"name":"John Smith","language_id":1}' localhost:1323/users

Read

$ curl localhost:1323/users/1

Update

$ curl -X PUT -H 'Content-Type: application/json' -d '{"name":"John Smith","language_id":1}' localhost:1323/users/1

Delete

$ curl -X DELETE localhost:1323/users/1

Test

$ go test ./... -cover