Goのサーバーサイド用のカリキュラム
このカリキュラムでは、Goを使用してシンプルなサーバーサイドアプリケーションを構築する方法を学びます。以下の内容を含みます:
- RESTful APIの設計と実装
- 商品(Product)に対するCRUD操作
- Echoフレームワークを使用したルーティング
- ユースケース層とリポジトリ層の分離
- テストの実装
curl -X GET http://localhost:8080/productscurl -X GET http://localhost:8080/products/1curl -X POST http://localhost:8080/products \
-H "Content-Type: application/json" \
-d '{
"name": "Sample Product",
"price": 1000
}'curl -X PUT http://localhost:8080/products/1 \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Product",
"price": 1500
}'curl -X DELETE http://localhost:8080/products/1-
Dockerイメージをビルドします。
docker compose build
-
コンテナを起動します。
docker compose up
-
上記のcurlコマンドを使用してAPIをテストします。