You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -113,6 +114,61 @@ You can set `appNameForURL` in the config file for each app to control the url o
113
114
114
115
To change the app to production, simply set `production` to `true` in your config file. The default value is false if not specified.
115
116
117
+
# Running as Express Middleware
118
+
119
+
Instead of starting Parse Dashboard with the CLI, you can also run it as an [express](https://github.com/expressjs/express) middleware.
120
+
121
+
```
122
+
var express = require('express');
123
+
var ParseDashboard = require('parse-dashboard');
124
+
125
+
var dashboard = new ParseDashboard({
126
+
"apps": [
127
+
{
128
+
"serverURL": "http://localhost:1337/parse",
129
+
"appId": "myAppId",
130
+
"masterKey": "myMasterKey",
131
+
"appName": "MyApp"
132
+
}
133
+
]
134
+
});
135
+
136
+
var app = express();
137
+
138
+
// make the Parse Dashboard available at /dashboard
139
+
app.use('/dashboard', dashboard);
140
+
141
+
var httpServer = require('http').createServer(app);
142
+
httpServer.listen(4040);
143
+
```
144
+
145
+
If you want to run both [Parse Server](https://github.com/ParsePlatform/parse-server) and Parse Dashboard on the same server/port, you can run them both as express middleware:
146
+
147
+
```
148
+
var express = require('express');
149
+
var ParseServer = require('parse-server').ParseServer;
150
+
var ParseDashboard = require('parse-dashboard');
151
+
152
+
var api = new ParseServer({
153
+
// Parse Server settings
154
+
});
155
+
156
+
var dashboard = new ParseDashboard({
157
+
// Parse Dashboard settings
158
+
});
159
+
160
+
var app = express();
161
+
162
+
// make the Parse Server available at /parse
163
+
app.use('/parse', api);
164
+
165
+
// make the Parse Dashboard available at /dashboard
166
+
app.use('/dashboard', dashboard);
167
+
168
+
var httpServer = require('http').createServer(app);
0 commit comments