问题
I am trying to setup parse for a personal hobby project - I have decided to have it deployed on Heroku.
I followed the steps on this readme : https://github.com/ParsePlatform/parse-server-example
I clicked on the DEPLOY to HEROKU
button. Everything went fine. BUT I am NOT able to access the Parse Dashboard
.
My configurations (its a test app - I will delete this & re-deploy, hence I am sharing the credentials) :
APP_NAME
: test1000000
SERVER_URL
: http://test1000000.herokuapp.com/parse
APP_ID
: test1000000
MATER_KEY
: myMasterKey
Is there something more I have to do?
When I try to access the below links on my browser, I see the following :
http://test1000000.herokuapp.com/parse
=>
Cannot GET /parse
http://test1000000.herokuapp.com/apps
=>
Cannot GET /apps
http://test1000000.herokuapp.com/
=>
I dream of being a website. Please star the parse-server repo on GitHub!
Am I missing something ?
回答1:
Yes you did. Check the documentation. If you really want them in the same application, look at this part of docs
If you want to run both Parse Server and Parse Dashboard on the same server/port, you can run them both as express middleware:
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var ParseDashboard = require('parse-dashboard');
var allowInsecureHTTP = false
var api = new ParseServer({
// Parse Server settings
});
var dashboard = new ParseDashboard({
// Parse Dashboard settings
}, allowInsecureHTTP);
var app = express();
// make the Parse Server available at /parse
app.use('/parse', api);
// make the Parse Dashboard available at /dashboard
app.use('/dashboard', dashboard);
var httpServer = require('http').createServer(app);
httpServer.listen(4040);
But it's much more safe to have the dashboard as another app(it's free on heroku, because free plan is more than enough for it), or even deploy it on your localhost. Also I don't have the dashboard on my app, I just doing my stuff directly in mongolab dashboard.
来源:https://stackoverflow.com/questions/39157486/how-to-access-parse-dashboard-on-heroku