martini-example

Created: 2014-05-19 18:02
Updated: 2019-01-13 15:30
License: unlicense
sql

README.md

Martini-Example

System dependencies

Installing Go

  • Install Go brew install go

  • Setup your Go environment:

    export GOPATH=<Your Go working directory here>
    export PATH="$PATH:$GOPATH/bin"
    

Installing Postgres

  • Install Postgres brew install postgres

    Alternatively, use postgres app.

Configuration

  • Create the database createdb example_app_dev

  • Populate it using the example db/seeds.sql file: psql -d example_app_dev < db/seeds.sql

  • Create .env file:

    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 get to 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 Godep to 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 save and add changed files inside Godeps directory.

Release

  • git push <heroku-remote> or git push <heroku-remote> <feature-branch>:master
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more