1

i'm using parse server and parse dashboard for my push notification and DB stuffs, my problem is when i establish an ssh connection to my VPS and run them both everything is fine until i turn off my computer or disconnect from the server dashboard and parse server will terminated! is there any solution to make them online permanently?

commands i use:
for starting the parse server ->

npm start

for starting the parse dashboard ->

parse-dashboard --config config.json --allowInsecureHTTP

even i tried to duplicate nodejs running but it doesn't work.

Eric
  • 460
  • 6
  • 15

2 Answers2

1

Include the ParseDashboard inside your ParseServer. If you are using the parse-server-example, install parse-dasboard inside parse-server-example using npm install parse-dashboard and copy this inside index.js

var ParseDashboard = require('parse-dashboard');
var ParseServer = require('parse-server').ParseServer;

var dashboard = new ParseDashboard({
    "apps": [{
            "serverURL": "https://yourserver.url",
            "appId": "myAppId",
            "masterKey": "myMasterKey",
            "appName": "YourAppName"
        }
    ],
    "users": [{
        "user": "user",
        "pass": process.env.USER_PASS || "pass"
    }]
}, allowInsecureHTTP);

var api = new ParseServer({
    databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
    cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
    appId: process.env.APP_ID || 'myAppId',
    masterKey: process.env.MASTER_KEY || '', //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
    liveQuery: {
        classNames: ["Post", "Comments"] // List of classes to support for query subscriptions
    }
});
Leandro P
  • 213
  • 4
  • 12
  • Would this not be available and exposed to anyone then? Dashboard uses the secret master key which is not used in exposed applications. The dashboard should be used externally from the parse server IMO. – hybrdthry911 Dec 04 '16 at 07:58
0

usually, whenever you exit your SSH session, your active session will be killed. Using screen command will create a session that will not be killed even you closed your terminal / exit SSH. And you can do exactly what you usually do.

described in this link: https://github.com/ParsePlatform/parse-dashboard/issues/162

enter screen at SSH session.some instruction and info will display, dismiss it with spacebar. here you go, a new screen that will remain running even you exit your SSH session.you might run the following command:

cd /var/www/parse/parse-dashboard npm start --config some/path/to/parse-dashboard-config.json --allowInsecureHTTP=1

thanks to @cricket_007

Eric
  • 460
  • 6
  • 15