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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ We want to make contributing to this project as easy and transparent as
3
3
possible.
4
4
5
5
## Our Development Process
6
-
Get started by cloning this repository and and running `npm install` inside it. Create a file called `parse-dashboad-config.json` in the Parse-Dashboard folder inside the repo, using the format described in the readme.
6
+
Get started by cloning this repository and and running `npm install` inside it. Create a file called `parse-dashboard-config.json` in the Parse-Dashboard folder inside the repo, using the format described in the readme.
7
7
8
8
When working on the dashboard, use `npm run dashboard` and visit `localhost:4040` to see your dashboard. The `npm run dashboard` script will automatically re-build your files when you change them, so after making a change, all you need to do is refresh the page.
Copy file name to clipboardExpand all lines: Parse-Dashboard/index.js
+24-5Lines changed: 24 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ program.option('--host [host]', 'the host to run parse-dashboard');
22
22
program.option('--port [port]','the port to run parse-dashboard');
23
23
program.option('--mountPath [mountPath]','the mount path to run parse-dashboard');
24
24
program.option('--allowInsecureHTTP [allowInsecureHTTP]','set this flag when you are running the dashboard behind an HTTPS load balancer or proxy with early SSL termination.');
25
+
program.option('--sslKey [sslKey]','the path to the SSL private key.');
26
+
program.option('--sslCert [sslCert]','the path to the SSL certificate.');
25
27
26
28
program.parse(process.argv);
27
29
@@ -39,6 +41,8 @@ let configAppId = program.appId || process.env.PARSE_DASHBOARD_APP_ID;
@@ -20,7 +21,7 @@ Parse Dashboard is a standalone dashboard for managing your Parse apps. You can
20
21
21
22
# Getting Started
22
23
23
-
[Node.js](https://nodejs.org) version >= 4.3 is required to run the dashboard. You also need to be using Parse Server version 2.1.4 or higher.
24
+
[Node.js](https://nodejs.org) version >= 4.3 is required to run the dashboard. You also need to be using Parse Server version 2.1.4 or higher.
24
25
25
26
# Local Installation
26
27
@@ -66,7 +67,7 @@ Managing multiple apps from the same dashboard is also possible. Simply add add
66
67
67
68
You can manage self-hosted [Parse Server](https://github.com/ParsePlatform/parse-server) apps, *and* apps that are hosted on [Parse.com](http://parse.com/) from the same dashboard. In your config file, you will need to add the `restKey` and `javascriptKey` as well as the other paramaters, which you can find on `dashboard.parse.com`. Set the serverURL to `http://api.parse.com/1`:
68
69
69
-
```json
70
+
```js
70
71
{
71
72
"apps": [
72
73
{
@@ -90,7 +91,7 @@ You can manage self-hosted [Parse Server](https://github.com/ParsePlatform/parse
90
91
91
92
## App Icon Configuration
92
93
93
-
Parse Dashboard supports adding an optional icon for each app, so you can identify them easier in the list. To do so, you *must* use the configuration file, define an `iconsFolder` in it, and define the `iconName` parameter for each app (including the extension). The path of the `iconsFolder` is relative to the configuration file. To visualize what it means, in the following example `icons` is a directory located under the same directory as the configuration file:
94
+
Parse Dashboard supports adding an optional icon for each app, so you can identify them easier in the list. To do so, you *must* use the configuration file, define an `iconsFolder` in it, and define the `iconName` parameter for each app (including the extension). The path of the `iconsFolder` is relative to the configuration file. If you have installed ParseDashboard globally you need to use the full path as value for the `iconsFolder`. To visualize what it means, in the following example `icons` is a directory located under the same directory as the configuration file:
94
95
95
96
```json
96
97
{
@@ -109,18 +110,73 @@ Parse Dashboard supports adding an optional icon for each app, so you can identi
109
110
110
111
## Other Configuration Options
111
112
112
-
You can set `appNameForURL` in the config file for each app to control the url of your app within the dashboard. This can make it easier to use bookmarks or share links on your dashboard.
113
+
You can set `appNameForURL` in the config file for each app to control the url of your app within the dashboard. This can make it easier to use bookmarks or share links on your dashboard.
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);
169
+
httpServer.listen(4040);
170
+
```
171
+
116
172
# Deploying Parse Dashboard
117
173
118
174
## Preparing for Deployment
119
175
120
176
Make sure the server URLs for your apps can be accessed by your browser. If you are deploying the dashboard, then `localhost` urls will not work.
121
177
122
178
## Security Considerations
123
-
In order to securely deploy the dashboard without leaking your apps master key, you will need to use HTTPS and Basic Authentication.
179
+
In order to securely deploy the dashboard without leaking your apps master key, you will need to use HTTPS and Basic Authentication.
124
180
125
181
The deployed dashboard detects if you are using a secure connection. If you are deploying the dashboard behind a load balancer or proxy that does early SSL termination, then the app won't be able to detect that the connection is secure. In this case, you can start the dashboard with the `--allowInsecureHTTP=1` option. You will then be responsible for ensureing that your proxy or load balancer only allows HTTPS.
126
182
@@ -155,20 +211,20 @@ To do so, update your `parse-dashboard-config.json` configuration file to match
0 commit comments