RESTfulAPI with Golang and Postgres
cp docker/pgweb/.env.sample docker/pgweb/.env
cp docker/go/.env.sample docker/go/.env
cp docker/postgres/.env.sample docker/postgres/.env
docker-compose build
docker-compose up
GET / # Hello World!!
GET /users # user の一覧を表示
GET /users/:id # 指定した id の user を表示
POST /users # user を追加
PUT /users/:id # 指定した id の user を更新
DELETE /users/:id # 指定した id の user を削除
curl -XPOST -H 'Content-Type:application/json' http://localhost:8080/users -d '{"name": "test", "email": "hoge@example.com" }'
curl -XPUT -H 'Content-Type:application/json' http://localhost:8080/users/1 -d '{"name": "koudaiii", "email": "hoge@example.com" }'
curl -XGET -H 'Content-Type:application/json' http://localhost:8080/users/1
curl -XGET -H 'Content-Type:application/json' http://localhost:8080/users
curl -XDELETE -H 'Content-Type:application/json' http://localhost:8080/users/1
localhost:8081