Skip to content

shruthihub/restapi-mongodb-odo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to install application and service in odo:

  1. Install percona distribution mongodb operator on cluster
  2. odo create project mongodb-restapi
  3. odo create go restapi
  4. odo service create --from-file mongo-cluster.yaml
  5. odo link

REST API with Go and MongoDB

REST API with Golang and MongoDB.

  • HTTP router
  • CRUD operations
  • MongoDB supported driver for Go
  • ENV configurations
  • Formatted logs

Dependencies

go get github.com/gorilla/mux
go get go.mongodb.org/mongo-driver/mongo
go get github.com/spf13/viper
go get github.com/githubnemo/CompileDaemon

Build

go build

Run

ENV=dev ./go-rest-mongodb
ENV=prod ./go-rest-mongodb

Watch

CompileDaemon -command="./go-rest-mongodb"

API

Postman collection

Postman collection

Resources

mux: A powerful HTTP router and URL matcher for building Go web servers. https://github.com/gorilla/mux

mongo-driver: The MongoDB supported driver for Go. https://github.com/mongodb/mongo-go-driver

viper: Viper is a complete configuration solution for Go applications including 12-Factor apps. https://github.com/spf13/viper

CompileDaemon: Watches your .go files in a directory and invokes go build if a file changed. https://github.com/githubnemo/CompileDaemon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published