Skip to content

Commit b499e1a

Browse files
committed
reapplied appja changes
1 parent e8e899c commit b499e1a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Parse-Dashboard/app.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = function (config, options) {
107107
});
108108

109109
// Serve the configuration.
110-
app.get('/parse-dashboard-config.json', async (req, res) => {
110+
app.get('/parse-dashboard-config.json', async function (req, res) {
111111
const apps = config.apps.map(app => Object.assign({}, app)); // make a copy
112112
const response = {
113113
apps,
@@ -1282,7 +1282,7 @@ You have direct access to the Parse database through function calls, so you can
12821282
});
12831283

12841284
// For every other request, go to index.html. Let client-side handle the rest.
1285-
app.get('/*', function (req, res) {
1285+
app.get('/*', function (req, res, next) {
12861286
if (users && (!req.user || !req.user.isAuthenticated)) {
12871287
const redirect = req.url.replace('/login', '');
12881288
if (redirect.length > 1) {
@@ -1293,7 +1293,8 @@ You have direct access to the Parse database through function calls, so you can
12931293
if (users && req.user && req.user.matchingUsername) {
12941294
res.append('username', req.user.matchingUsername);
12951295
}
1296-
res.send(`<!DOCTYPE html>
1296+
if (!req.path.startsWith('/v2')) {
1297+
res.send(`<!DOCTYPE html>
12971298
<html>
12981299
<head>
12991300
<link rel="shortcut icon" type="image/x-icon" href="${mountPath}favicon.ico" />
@@ -1310,6 +1311,9 @@ You have direct access to the Parse database through function calls, so you can
13101311
</body>
13111312
</html>
13121313
`);
1314+
} else {
1315+
next();
1316+
}
13131317
});
13141318
});
13151319

0 commit comments

Comments
 (0)