- Go Web Framework: Echo https://echo.labstack.com
- Basic REST API (List, View, Create, Update, Delete)
- Database Connection
- Basic Routing, Middleware, Handler, Logger
- Basic Clean Architecture (Repository, Entity, Services)
- Create DB, import
db/ddl.sql
- Configure database connection in
mysql.go
go run .
go build
./echo
curl -X GET http://localhost:8000/employees -H 'Accept: application/json'
curl -X GET http://localhost:8000/employees/1 -H 'Accept: application/json'
curl -X POST \
http://localhost:8000/employees \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Test Name",
"city": "Jakarta"
}'
curl -X PUT \
http://localhost:8000/employees/1 \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Name New",
"city": "City New"
}'
curl -X DELETE http://localhost:8000/employees/1