Sample Application Structure for Echo
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
api Add "position" Jun 8, 2016
conf Refactoring Jun 5, 2016
db Add "position" Jun 8, 2016
handler Refactoring Jun 5, 2016
middleware some modifications Jun 5, 2016
model Add "position" Jun 8, 2016
route Add "position" Jun 8, 2016
vendor vendoring Jun 8, 2016
.gitignore Initial Commit Nov 28, 2015
LICENSE Initial commit Nov 28, 2015
README.md Modify README Jun 8, 2016
glide.lock vendoring Jun 8, 2016
glide.yaml vendoring Jun 5, 2016
main.go Refactoring Jun 5, 2016

README.md

echo-sample

Sample Application Structure for micro Web Application Framework Echo.

HTTP Request Sample

POST

curl -H "Content-Type: application/json" -X POST -d '{"name":"Luis", "number": 9, "position": "FW"}' http://localhost:8888/api/v1/members
curl -H "Content-Type: application/json" -X POST -d '{"name":"Lionel", "number": 10, "position": "FW"}' http://localhost:8888/api/v1/members

# => {"number":10, "name":"Lionel", "position":"FW", "createdAt":1465415304}

GET a record

curl -H "Content-Type: application/json" -X GET http://localhost:8888/api/v1/members/10

# => {"number":10, "name":"Lionel", "position":"FW", "createdAt":1465415304}

GET records

curl -H "Content-Type: application/json" -X GET http://localhost:8888/api/v1/members

# => [
       {"number":9, "name":"Luis", "position":"FW", "createdAt":1465415304},
       {"number":10,"name":"Lionel", "position":"FW", "createdAt":1465415304}
     ]