Web service backing goboard, an app for faster multiplayer boardgame setup.
-
Fetch dependencies
Everything you need is imported in
meeple_mover.go
, sogo get
it. -
Install PostgreSQL
-
Create the database and schema
pg_restore schema.psql
heroku create -b https://github.com/kr/heroku-buildpack-go.git
This will let the service set the HTTP headers that browsers require to allow Cross-Origin Resource Sharing (CORS):
heroku config:set MEEPLE_MOVER_ORIGIN_URL=http://example.com
Copy the contents of your local DB to Heroku:
heroku pg:push $LOCAL_DB_NAME DATABASE_URL
Where:
- $LOCAL_DB_NAME is the name of your local Postgres database for meeple_mover (default: meeple_mover)
- DATABASE_URL is literally that string. It's what the heroku tool craves.
You may have to heroku pg:reset DATABASE_URL
, which blows away all your data on the Heroku DB.
git push heroku master
Run go test
in each subpackage directory.
It's useful to create a test database with fixture data in order to run integration tests on the goboard web front-end for meeple_mover.
psql -f schema-test.psql
psql -f data.psql
Start the server with this database by setting an environment variable:
MEEPLE_MOVER_DB_NAME=meeple_mover_test go run meeple_mover.go