Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict"
- const path = require("path")
- const express = require("express")
- const ParseServer = require("parse-server").ParseServer
- const ParseDashboard = require('parse-dashboard')
- const app = express()
- const port = process.env.PORT || 8080
- const appConfig = {
- appId: process.env.PARSE_APP_ID || "",
- serverURL: process.env.PARSE_SERVER_URL || "http://localhost:" + port + "/parse",
- masterKey: process.env.PARSE_MASTER_KEY || "",
- fileKey: process.env.PARSE_FILE_KEY || "",
- appName: "NattrServer"
- }
- const dashboardMount = "/"
- const dashboard = new ParseDashboard({
- apps: [ appConfig ],
- users: [ {
- user: process.env.PARSE_ADMIN_USERNAME || "admin",
- pass: process.env.PARSE_ADMIN_PASSWORD || "648961a80a2d"
- } ]
- }, true)
- const api = new ParseServer(Object.assign({
- databaseURI: process.env.PARSE_DATABASE_URI || "mongodb://localhost:27017/dev",
- cloud: path.join(__dirname, "cloud/main.js"),
- }, appConfig))
- app.use(process.env.PARSE_MOUNT || "/parse", api)
- app.use(dashboardMount, dashboard);
- app.listen(port, function() {
- console.log("parse-server-example running on port " + port)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement