RESTfull API build on :
- Go Language
- MVC Pattern
- Lib Go : mux, monggo-driver, godotenv
- Mongo DB Community
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 ./
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 |
File on Directory file/postman
MIT