- In Golang
- Using MongoDB
OR
Via Docker's MongoDB image
Make sure you have GOPATH environment variable set properly.
-
Install Golang and run:
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc
go get labix.org/v2/mgo
go get golang.org/x/net/context
-
Install MongoDB and run the server:
mongod
OR
Install Docker and run the following:docker run -p 27017:27017 -d mongo
cd $HOME/src/github.com/
git clone https://github.com/maniknarang/gRPC-CRUD-App.git
Make sure MongoDB server is up and running on 127.0.0.1:27017
.
Open two terminals and run: cd $HOME/src/github.com/gRPC-CRUD-App
on both of them.
First terminal:
go run server/server.go
Hit allow on the popup.
Second terminal:
go run cmd/server/main.go
go run server/server.go
go test tests/server_test.go