Skip to content

kei178/go-mongo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-mongo-api

REST API example with GO & MongoDB

Requirements

Running

docker-compose up

You can access the API server at http://localhost:8080.

If you change something, execute the following command, instead:

docker-compose up --build

Shutdown

docker-compose down

APIs

The entity Book has the following fields:

  • ID (primitive.ObjectID)
  • title (string)
  • author (string)

Books APIs are as follows:

METHOD ENDPOINT REQUEST HEADERS REQUEST PAYLOAD RESPONSE PAYLOAD
GET /books Book[]
POST /books Content-Type: "application/json" Book Create result
GET /books/:id Book
PUT /books/:id Content-Type: "application/json" Book Update result
DELETE /books/:id Delete result

About

REST API example with GO & MongoDB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published