|
@@ -5,29 +5,22 @@ var express = require('express');
|
|
|
var ParseServer = require('parse-server').ParseServer;
|
|
|
var path = require('path');
|
|
|
|
|
|
-var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;
|
|
|
+var databaseUri = process.env.PARSE_QRS_URL || process.env.MONGODB_URI;
|
|
|
|
|
|
if (!databaseUri) {
|
|
|
console.log('DATABASE_URI not specified, falling back to localhost.');
|
|
|
}
|
|
|
-var DB_URI = 'mongodb://'+process.env.MONGO_USER+':'+process.env.MONGO_PASWORD+'@localhost:27017/qrs' || 'mongodb://localhost:27017/qrs';
|
|
|
var api = new ParseServer({
|
|
|
- //databaseURI: databaseUri || 'mongodb://localhost:27017/qrs',
|
|
|
- databaseURI: DB_URI,
|
|
|
+ databaseURI: databaseUri || 'mongodb://localhost:27017/qrs',
|
|
|
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
|
|
|
appId: process.env.APPLICATION_ID_QRS || 'myAppId',
|
|
|
- masterKey: process.env.MASTER_KEY_QRX || '', //Add your master key here. Keep it secret!
|
|
|
- serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
|
|
|
+ masterKey: process.env.MASTER_KEY_QRS || '', //Add your master key here. Keep it secret!
|
|
|
+ serverURL: process.env.SERVER_URL_PARSE_QRS || 'http://localhost:1337/parse', // Don't forget to change to https if needed
|
|
|
liveQuery: {
|
|
|
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
|
|
|
}
|
|
|
});
|
|
|
-console.log(DB_URI);
|
|
|
-console.log(process.env.MASTER_KEY_QRX);
|
|
|
-console.log(process.env.SERVER_URL);
|
|
|
-// Client-keys like the javascript key or the .NET key are not necessary with parse-server
|
|
|
-// If you wish you require them, you can set them as options in the initialization above:
|
|
|
-// javascriptKey, restAPIKey, dotNetKey, clientKey
|
|
|
+
|
|
|
|
|
|
var app = express();
|
|
|
|
|
@@ -40,7 +33,7 @@ app.use(mountPath, api);
|
|
|
|
|
|
// Parse Server plays nicely with the rest of your web routes
|
|
|
app.get('/', function(req, res) {
|
|
|
- res.status(200).send('I dream of being a website. Please star the parse-server repo on GitHub!');
|
|
|
+ res.status(200).send("It's alive!!");
|
|
|
});
|
|
|
|
|
|
// There will be a test page available on the /test path of your server url
|
|
@@ -49,7 +42,7 @@ app.get('/test', function(req, res) {
|
|
|
res.sendFile(path.join(__dirname, '/public/test.html'));
|
|
|
});
|
|
|
|
|
|
-var port = process.env.PORT || 1337;
|
|
|
+var port = process.env.PARSE_PORT || 1337;
|
|
|
var httpServer = require('http').createServer(app);
|
|
|
httpServer.listen(port, function() {
|
|
|
console.log('parse-server-example running on port ' + port + '.');
|