Skip to content

Instantly share code, notes, and snippets.

@benjaminhallock
Last active June 5, 2016 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjaminhallock/5c26e9ef6b86abdafe45 to your computer and use it in GitHub Desktop.
Save benjaminhallock/5c26e9ef6b86abdafe45 to your computer and use it in GitHub Desktop.
How to Parse + Heroku
First, update your Parse Framework https://parse.com/docs/downloads
### Replace the original Appid/ClientKey with....
Parse.initializeWithConfiguration(ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) -> Void in
configuration.applicationId = "myAppId";
configuration.clientKey = "myClientKey";
//need ngrok to host locally, haven't tried it.
// configuration.server = @"http://localhost:1337/parse";
configuration.server = "https://YOUR-HEROKU-SERVER.herokuapp.com/parse";
}))
Assuming you know Heroku Toolbelt for cmd line, follow these instructions to install this server in under a minute.
https://github.com/ParsePlatform/parse-server-example
### In your server folder, add clientKey to index.js, ios requires a clientKey, then push it up again. (Pick a secure password tho)
var api = new ParseServer({
databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: 'myAppId',
clientKey: 'myClientKey',
masterKey: 'myMasterKey'
});
### So if you need to migrate data, here's what the parse tutorial claims.
Once you have Mongo setup, take note of the Mongo connection URL.
Use the database migration tool to transfer your data (found in the new dashboard under App Settings → General → Migrate to external database).
Ensure that the user in the connection string has admin privileges, as the migration tool will set some paramaters automatically during the process.
### Some parts of Parse don't work currently.
I had trouble with anonymous users, so don't assume that works.
It's also hard to get 3rd party cloud code working (Twilio, Stripe, etc), so don't count on those right away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment