Created
November 12, 2012 22:20
-
-
Save djensen47/4062384 to your computer and use it in GitHub Desktop.
Grails Configuration for MongoDB on AppFog (or Cloud Foundry)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You'll need configuration like this to get MongoDB up and running with Grails on AppFog | |
// This config will also work locally | |
grails { | |
def vcap = System.env.VCAP_SERVICES | |
def credentials = vcap ? grails.converters.JSON.parse(vcap)["mongodb-1.8"][0]["credentials"] : null | |
mongo { | |
host = credentials ? credentials.hostname : "localhost" | |
port = credentials ? credentials.port : "27017" | |
username = credentials ? credentials.username : null | |
password = credentials ? credentials.password : null | |
databaseName = credentials ? credentials.db : "your-localhost-db-name" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment