forked from felixrieseberg/parse-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.js
More file actions
executable file
·28 lines (23 loc) · 854 Bytes
/
parse.js
File metadata and controls
executable file
·28 lines (23 loc) · 854 Bytes
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
const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const app = express();
const port = process.env.PORT || 8080;
// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
const parse = new ParseServer({
databaseURI: 'mongodb://localhost:27017/dev',
cloud: '/usr/src/parse/cloud/main.js',
appId: process.env.APP_ID,
masterKey: process.env.MASTER_KEY,
fileKey: process.env.FILE_KEY,
serverURL: 'http://localhost:1337/parse'
});
// Serve the Parse API on the /parse URL prefix
app.use('/parse', parse);
// Hello world
app.get('/', (req, res) => {
res.status(200).send('Express is running here.');
});
app.listen(port, () => {
console.log(`Docker Parse Server running on port ${port} with appId ${process.env.APP_ID}`);
});