A sample Phoenix app with Grand Rapids flair
Switch branches/tags
Nothing to show
Clone or download
Latest commit 01f597e Mar 22, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Base Phoenix install Mar 20, 2015
lib Accept JSON parameters Mar 21, 2015
priv/static/images Base Phoenix install Mar 20, 2015
test Base Phoenix install Mar 20, 2015
web Accept JSON parameters Mar 21, 2015
.gitignore Base Phoenix install Mar 20, 2015
LICENSE Add LICENSE Mar 22, 2015
README.md Clarify description Mar 22, 2015
brunch-config.js Base Phoenix install Mar 20, 2015
mix.exs Base Phoenix install Mar 20, 2015
mix.lock Base Phoenix install Mar 20, 2015
package.json Base Phoenix install Mar 20, 2015

README.md

Artprize Voting App (Phoenix Framework/GenServer version)

Demo for GRDevDay 2015

See the accompanying slides here.

To start your new Phoenix application:

  1. Install dependencies with mix deps.get
  2. Start Phoenix endpoint with mix phoenix.server

Now you can visit localhost:4000 from your browser.

The demo app contains a single endpoint, /vote that accepts a POST to make a new vote, and a GET to see the current winner.

To make a vote, make a post to the API:

curl -X POST \
  -F user_id=12 \
  -F entry_id=45 \
  -F location[lat]=-85.6 \
  -F location[lng]=43.0 \
  http://localhost:4000/vote

When you visit votes in the URL, you should see your vote totals!