Go-CleanArchitecture-APIServer
Go(Echo)×GORM×CleanArchitectureでAPIServerを作成。
$ [email protected]:taiki1288/Go-CleanArchitecture-APIServer.git
$ cd Go-CleanArchitecture-APIServer
$ docker-compose up -d
$ go run server.go
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id": 1, "name": "test", "email": "[email protected]", "age": 20}' localhost:1323/users
$ curl -i -H 'Content-Type:application/json' localhost:1323/users
$ curl -i -H 'Content-Type:application/json' localhost:1323/users/1
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"id": 1, "name": "testtest", "email": "[email protected]", "age": 21}' localhost:1323/users/1
$ curl -i -H "Accept: application/json" -H "Content-type: application/json" -X DELETE localhost:1323/users/1