Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This branch is 23 commits ahead, 4 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
conf
project
public/images
.gitignore
Procfile
README.md

README.md

This sample uses Play 2.1. The recommendation is to use this snapshot.

It also depends on Scala 2.10, which is currently at 2.10.0-RC2

The sample uses the ReactiveMongo plugin for play which is configured in play.plugins.

Deployment on Heroku is not yet working.

Deploy on Heroku

  1. Install the Heroku Toolbelt

  2. Signup for a Heroku Account

  3. Login to Heroku:

    $ heroku login
    
  4. Create a new Heroku app:

    $ heroku create
    
  5. Add the MongoHQ Add-on

    $ heroku addons:add mongohq
    
  6. Push the local repo to Heroku:

    $ git push heroku scala-mongodb:master
    
  7. Open the app:

    $ heroku open
    

Local Setup (OS X Specific)

  1. Download MongoDB

  2. Extract MongoDB:

    tar -zxvf mongo.tgz
    
  3. Create a directory for data (personal preference is under the MongoDB directory):

    sudo mkdir -p /apps/mongodb-osx-x86_64-2.2.1/data/db 
    

    If you create the data directory in the root file system update the permissions:

    sudo chown `id -u` data/db
    
  4. Add the MongoDB bin directory to the system path. Modify ~/.bash_profile and add the following (customize for where you extracted MongoDB):

    export PATH=/apps/mongodb-osx-x86_64-2.2.1/bin:$PATH
    
  5. Run MongoDB:

    mongod --dbpath=/apps/mongodb-osx-x86_64-2.2.1/data/db/
    
  6. Run the play application - in the play2bars directory run:

    play run 
    
  7. You can query mongo to see the bars entered in the db. At a terminal prompt enter:

    mongo
    use play2bars
    db.bars.find()
    db.bars.count()
    
Something went wrong with that request. Please try again.