Sample web app in Go pushed to Predix Cloud reading data from PostgresDB on Predix.
- Predix.io account
- PostgreSQL instance on Predix
On your local machine:
- CF CLI
- Git
- Go (v.1.9.x)
- GoVendor: install it with
go get -u github.com/kardianos/govendor
- Clone the repos:
$ go get -u https://github.com/indaco/predix-go-sample-app
- Move to the app folder:
$ cd $GOPATH/src/github.com/indaco/predix-go-sample-app
- Sync dependencies:
$ $GOPATH/bin/govendor sync
- Edit config.json and update it with Predix Postgres credentials
- Use the sample
db.sql
file to create a dummy table with some entries on PostgreSQL or adapt the main.go code to reflect the data table on PostgreSQL - Edit manifest.yml file and update the application name
- Push the app to Predix Cloud:
$ cf push