Martini-Example
System dependencies
Installing Go
-
Install Go
brew install go -
Setup your
Goenvironment:export GOPATH=<Your Go working directory here> export PATH="$PATH:$GOPATH/bin"
Installing Postgres
-
Install Postgres
brew install postgresAlternatively, use postgres app.
Configuration
-
Create the database
createdb example_app_dev -
Populate it using the example
db/seeds.sqlfile:psql -d example_app_dev < db/seeds.sql -
Create
.envfile:DATABASE_URL="dbname=example_app_dev sslmode=disable" API_USERNAME=<username> API_PASSWORD=<password>See lib/pq docs to see more details about connection parameters
-
Run
go getto install app dependencies -
Run app
go run main.go
Tests
None
Deployment
Deployment instructions for heroku.
Setup
-
Make sure to have the heroku toolbelt installed.
-
Then run:
heroku create <app-name> -b https://github.com/kr/heroku-buildpack-go.git
-
Add the heroku git repository to your git remotes
-
Install
Godepto manage app dependencies by running:go get github.com/tools/godep
Before pushing
- Every time that you add a new a dependency, make sure run
godep saveand add changed files insideGodepsdirectory.
Release
git push <heroku-remote>orgit push <heroku-remote> <feature-branch>:master