-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (26 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Example express application adding the parse-dashboard module to expose Parse Dashboard compatible API routes.
var express = require('express');
var ParseDashboard = require('parse-dashboard');
var path = require('path');
var dashboard = new ParseDashboard({
let localParseServer = 'http://localhost:1337/parse';
// Heroku requires HTTPS. Please read the README file for details.
// let herokuParseServer = 'https://my-parse-dashboard.herokuapp.com/parse'
apps: [
{
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || 'myMasterKey',
serverURL: process.env.SERVER_URL || herokuParseServer || localParseServer,
appName: process.env.APP_NAME || 'MyApp',
},
],
});
var app = express();
app.enable('trust proxy');
// make the Parse Dashboard available at /
app.use('/', dashboard);
var port = process.env.PORT || 4040;
var httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
console.log('parse-dashboard-example running on port ' + port + '.');
});