AzizSudrajat / go_restfullapi_mongo

Build RESTfull API with Golang and MongoDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang RESTfull API

RESTfull API build on :

Installation

Golang required Link go1.15.* to run Mongo DB Community required Link

- Download or Clone from Github -
cd go_restfullapi_mongo
touch .env
echo "PORT=:8000" >> .env
echo "CONNECTION_STRING=mongodb://{yourhost}/{yourcollection}" >> .env

Running Code

go build main.go
go run ./

API Endpoint

METHOD ENDPOINT Description
GET http://{yourhost}:8000/api/books GET ALL Book
GET http://{yourhost}:8000/api/books/{id} GET ONE Book
POST http://{yourhost}:8000/api/books CREATE Book
PUT http://{yourhost}:8000/api/books/{id} UPDATE Book
DELETE http://{yourhost}:8000/api/books/{id} DELETE Book

Postman Collection

File on Directory file/postman

License

MIT

About

Build RESTfull API with Golang and MongoDB


Languages

Language:Go 99.2%Language:Shell 0.8%