Golang HTTP API example like django project
https://github.com/bxcodec/go-clean-arch
- Echo Framework - HTTP Router
- GORM - ORM
- logrus - LOG Util
- validator - data validate util
- Golang 1.7이상 설치
go mod download
터미널에서 실행 (프로젝트 루트에서)
pip install -r requirements.txt
나npm install
이랑 같은 맥락
# go mod download all
go run .
터미널에서 실행 (프로젝트 루트에서)
# go run .
# go build -o app .
./app
터미널에서 실행 (프로젝트 루트에서)
# ./app
목록 가져오기
# curl -X GET http://localhost:8000/articles
생성
# curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"제목에 대한 데이터\",\"content\":\"컨텐츠에 대한 데이터\",\"author\":{\"id\":1}}" http://localhost:8000/articles
읽기
# curl -X GET http://localhost:8000/articles/{id}
삭제
# curl -X DELETE http://localhost:8000/articles/{id}