Skip to content

an example of Golang rest API using Echo framework

License

Notifications You must be signed in to change notification settings

alamyudi/echo-app

Repository files navigation

Echo-app is an example of golang rest api using echo framework, included :

  • Rest API
    • using echo framework to managing content and product
    • Splitting between model business and application presentation
    • Configurable the app to running in certain environment
    • request and response serializer and validation
    • ORM
    • Unit test
  • Vendoring a golang dependencies using glide as a package management
  • Hot reloading using realize
  • Dockerizing the app and mysql
  • CI/CD
  • Generate postman collection

Running the app using docker

docker-compose up --build

access it using curl or postman in http://localhost:8081/v1 as base url. for example :

curl -X GET \
  http://localhost:8081/v1/product \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Basic ZWNobzplY2hvZWg='

Building the executable

env GOOS=linux GOARCH=amd64 go build -v .