This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
49 lines (42 loc) · 1.17 KB
/
server.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require('dotenv').config()
const express = require('express')
const ParseServer = require('parse-server').ParseServer
const ParseDashboard = require('parse-dashboard')
const api = new ParseServer({
databaseURI: process.env.DATABASE_URL,
appId: process.env.APP_ID,
masterKey: process.env.MASTER_KEY,
cloud: './src/cloud/main.js',
serverURL: process.env.SERVER_URL,
clientKey: process.env.CLIENT_KEY
})
const dashboard = new ParseDashboard({
apps: [
{
serverURL: process.env.SERVER_URL,
appId: process.env.APP_ID,
masterKey: process.env.MASTER_KEY,
appName: process.env.APP_NAME
}
],
users: [
{
user: process.env.ADMIN_USER,
pass: process.env.ADMIN_PASSWORD,
apps: [
{
appId: process.env.APP_ID
}
]
}
]
}, { allowInsecureHTTP: true })
const app = express()
app.use('/parse', api)
app.use('/dashboard', dashboard)
const serverLogo = require('./src/utils/logo')
console.log(serverLogo('1.2.0', new Date()))
var httpServer = require('http').createServer(app)
httpServer.listen(process.env.PORT, function () {
console.log('Info: Server running on port ' + process.env.PORT + '.')
})