Skip to content

Golang API with Clean Architecture and using Makefile to run

Notifications You must be signed in to change notification settings

marcosmariano/go-clean-arch-api

Repository files navigation

Clean Arch in Go

Read about Clean Architecture

Build

  make

Run tests

  make test

Run API

  make run-api

API requests

Add book

curl -X "POST" "http://localhost:8080/v1/book" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
  "title": "I Am Ozzy",
  "author": "Ozzy Osbourne",
  "pages": 294,
  "quantity":10
}'

Search book

curl "http://localhost:8080/v1/book?title=ozzy" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'

Show books

curl "http://localhost:8080/v1/book" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json'