Skip to content

Instantly share code, notes, and snippets.

@dongalor
Created November 25, 2018 17:27
Show Gist options
  • Save dongalor/39ce1918bcf6c1eef3d5a137e4f092e9 to your computer and use it in GitHub Desktop.
Save dongalor/39ce1918bcf6c1eef3d5a137e4f092e9 to your computer and use it in GitHub Desktop.
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
var iosCertPath = process.env.PARSE_CERT || '../certs/my_cert.p12';
var api = new ParseServer({
databaseURI: 'mongodb://user:[email protected]:27017/db', // Connection string for your MongoDB database
cloud: './cloud/main.js', // Absolute path to your Cloud Code
appId: 'APPID',
masterKey: 'APPKEY', // Keep this key secret!
fileKey: 'APPFILEKEY',
serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed
verbose: true,
push: {
ios: {
pfx: iosCertPath,
topic: "com.company.MyApp",
production: true
}
}
}
);
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);
app.listen(1337, function() {
console.log('parse-server-example running on port 1337.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment