Skip to content

Instantly share code, notes, and snippets.

@niraj-shah niraj-shah/app.js
Created Jan 31, 2016

Embed
What would you like to do?
Parse Server Express App
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer({
databaseURI: 'mongodb://localhost:27017/myapp',
appId: '{YOUR_APP_ID}',
masterKey: '{YOUR_APP_MASTER_KEY}',
fileKey: 'optionalFileKey'
});
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);
// Hello world
app.get('/', function(req, res) {
res.status(200).send('Express is running here.');
});
var port = process.env.PORT || 1377;
app.listen(port, function() {
console.log('Parse Server running on port ' + port + '.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.