Skip to content

sarathsp06/gorest

Repository files navigation

GoREST REST Servive documentation

A Simple REST application using golang,docker,mongo

Technology

  • Go 1.11
  • Database
    • MongoDB connection details:
      • host: mongodb
      • port: 27017

Instructions

  1. 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

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

Available Resources

Name Method URL Protected
About GET /
List GET /orders
Create POST /order
Update PUT/PATCH /order/{id}

TODO

References

About

Rest Service in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages