This repository is Test app. I practice golang.
- git install
- docker install
- golang-migrate(v4.15.2) install
1. git clone git@github.com:You-saku/echo-docker-sample.git
3. cd echo-docker-sample
4. cp api/.env.example api/.env
5. make setup
6. make start
7. open http://localhost:80 (another terminal)
- いろんなアーキテクチャに挑戦
- postman-schemaディレクトリにpostmanでAPI叩けるようにするファイルを用意
- importして使ってください(import方法は調べよう)
- localhost:3001のCORS設定をしてあります
-
参考
-
やってみたい
- 詳しくは公式Docへ
- makeコマンドでmigrationファイル作成(新規テーブル作成時に使えます)
make migration name=users // 複数形にすること
- go test :テスト実行
- go test -v :テスト実行(詳細な実行結果出力)
- go test -cover :テスト実行+コードカバレッジ
- go test -cover -v :テスト実行+コードカバレッジ(詳細な実行結果出力)
このリポジトリではディレクトリ構成の関係でコマンドは以下の通り
docker-compose exec go go test ./test