Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const api = new ParseServer({
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
serverURL: settings.parseServerURL,
databaseURI: settings.parseServerDatabaseURI,
});
const iconsFolder = process.env.NODE_ENV === 'development' ?
'./server/public/images' : './public/images';
app.use('/parse', api);
app.use(
'/dashboard',
// eslint-disable-next-line new-cap
ParseDashboard({
apps: [{
serverURL: settings.parseServerURL,
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
appName,
iconName: 'logo.png',
}],
iconsFolder,
users: settings.parseServerDashboardUsers,
}, true /* XX: use allowInsecureHTTPInParseDashboard, gotta use true for Heroku SSL */)
);
},
};
const api = new ParseServer({
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
serverURL: settings.parseServerURL,
databaseURI: settings.parseServerDatabaseURI,
});
const iconsFolder = process.env.NODE_ENV === 'development' ?
'./server/public/images' : './public/images';
app.use('/parse', api);
app.use(
'/dashboard',
// eslint-disable-next-line new-cap
ParseDashboard({
apps: [{
serverURL: settings.parseServerURL,
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
appName,
iconName: 'logo.png',
}],
iconsFolder,
users: settings.parseServerDashboardUsers,
}, true)
);
runPokemonFixture();
},
};
setup (app, appName, settings) {
Parse.initialize(settings.parseServerApplicationId, 'js-key', settings.parseServerMasterKey);
Parse.serverURL = settings.parseServerURL;
const api = new ParseServer({
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
serverURL: settings.parseServerURL,
databaseURI: settings.parseServerDatabaseURI
});
app.use('/parse', api);
app.use(
'/dashboard',
ParseDashboard({
apps: [{
serverURL: settings.parseServerURL,
appId: settings.parseServerApplicationId,
masterKey: settings.parseServerMasterKey,
appName,
iconName: 'todo-mvc-icon.png'
}],
iconsFolder: 'server/public/images',
// XX: fix this
users: [
{
"user": "admin",
"pass": "admin"
}
]
}, true)
masterKey: MASTER_KEY,
serverURL: SERVER_URL,
})
);
let users = [];
if (DASHBOARD_USERS) {
DASHBOARD_USERS.split(',').map(u => {
let [user, pass] = u.split(':');
users.push({user, pass});
});
}
server.use(
'/dashboard',
new ParseDashboard({
apps: [{
serverURL: SERVER_URL,
appId: APP_ID,
masterKey: MASTER_KEY,
production: !IS_DEVELOPMENT,
appName: 'Open Source Coinbase Index Fund',
}],
users,
useEncryptedPasswords: USE_ENCRYPTED_PASSWORDS,
trustProxy: TRUST_PROXY,
}, {
cookieSessionSecret: COOKIE_SESSION_SECRET,
allowInsecureHTTP: TRUST_PROXY,
})
);