GoREST REST Servive documentation
A Simple REST application using golang,docker,mongo
- Go 1.11
- Database
- MongoDB connection details:
- host:
mongodb
- port:
27017
- host:
- MongoDB connection details:
- Clone the repo
go get -d github.com/sarathsp06/gorest
cd $GOAPTH/src/github.com/sarathsp06/gorest
- Run
bash setup.sh
to setup the environment,once- creates a directory under current diretory to attach as log volume
- Run
bash start.sh
to run the service in docker - Vist localhost:8080 to see the details of the running instance
- Refer to the documentation for detail on API
- Logs are available in "$PWD/logs"
- access logs in
$PWD/logs/access.log
- application specific logs in
$PWD/logs/app.log
- access logs in
NOTE:
- Run
make
to see all the possible make commands - Run
su -c "setenforce 0"
, if logs directory is empty - If page,pageNum invalid the service would assume default (20,1)
- I have added google key in config file the account is not paid, change the config in
config.json.prod
with a valid key to run properly
Name | Method | URL | Protected |
---|---|---|---|
About | GET |
/ |
✘ |
List | GET |
/orders |
✘ |
Create | POST |
/order |
✓ |
Update | PUT/PATCH |
/order/{id} |
✓ |
- (API Doc)[https://documenter.getpostman.com/view/2799423/RWaLvT6K]
- Pagination
- Dockerize
- Add delay metrics
- Mongo db optimization ,adding indexes etc
- Re-enable the basic auth