https://golang.org/doc/install
$ brew install go
$ mkdir -p ~/go/{pkg,src,bin}
$ mkdir -p ~/go/src/github.com/seintun
$ cd ~/go/src/github.com/seintun && git clone https://github.com/seintun/dinesty.ninja-backend.git
$ cd dinesty.ninja-backend && touch config.toml
Bash
$ cd ~ && echo "export GOPATH=$HOME/go" >> .bash_profile && source ~/.bash_profile
(or) Zsh
$ cd ~ && echo "export GOPATH=$HOME/go" >> .zshrc && source ~/.zshrc
$ go get github.com/gorilla/handlers github.com/gorilla/mux gopkg.in/mgo.v2 gopkg.in/mgo.v2/bson github.com/BurntSushi/toml
Used for routing and CRUD Restful API
Used for HTTP logging
Used for dialing to MongoDB server
Used for creating BSON ObjectID
Used for reading config.toml file of mLab server and Yelp API key
server="<INSERT YOUR SECRET mLAB userInfo HERE INSIDE THE QUOTES>"
database="dinesty_ninja_db"
yelpURL="https://api.yelp.com/v3/businesses/"
yelpKey="<INSERT YOUR YELP API KEY HERE INSIDE THE QUOTES>"
- Create/Login account at https://www.yelp.com
- Visit https://www.yelp.com/developers/v3/manage_app to obtain your API key
- Fill-out form under Create New App for testing
- Copy API Key after completion
- Replace
- Create/Login account at https://mlab.com
- Create a database name: dinesty_ninja_db
- Replace server="" in the format of
mongodb://<dbuser>:<dbpassword>@ds0000.mlab.com:0000/dinesty_ninja_db
$ go run main.go