- Install percona distribution mongodb operator on cluster
- odo create project mongodb-restapi
- odo create go restapi
- odo service create --from-file mongo-cluster.yaml
- odo link
REST API with Golang and MongoDB.
- HTTP router
- CRUD operations
- MongoDB supported driver for Go
- ENV configurations
- Formatted logs
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
go build
ENV=dev ./go-rest-mongodb
ENV=prod ./go-rest-mongodb
CompileDaemon -command="./go-rest-mongodb"
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