[misc] optionally skip adding the routes of the launchpad module (#3194)

GitOrigin-RevId: 1fb797cf13fe715efe7b1161bdcfd8735f8f349e
This commit is contained in:
Jakob Ackermann 2020-09-15 16:15:35 +02:00 committed by Copybot
parent ede3b6a248
commit 0829e823a8
2 changed files with 6 additions and 0 deletions

View file

@ -562,6 +562,7 @@ module.exports = settings =
reloadModuleViewsOnEachRequest: process.env['NODE_ENV'] == 'development'
disableModule:
'user-activate': process.env['DISABLE_MODULE_USER_ACTIVATE'] == 'true'
'launchpad': process.env['DISABLE_MODULE_LAUNCHPAD'] == 'true'
domainLicences: [

View file

@ -10,12 +10,17 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const logger = require('logger-sharelatex')
const Settings = require('settings-sharelatex')
const LaunchpadController = require('./LaunchpadController')
const AuthenticationController = require('../../../../app/src/Features/Authentication/AuthenticationController')
const AuthorizationMiddleware = require('../../../../app/src/Features/Authorization/AuthorizationMiddleware')
module.exports = {
apply(webRouter, apiRouter) {
if (Settings.disableModule['launchpad']) {
logger.log({}, 'Skipping Init launchpad router')
return
}
logger.log({}, 'Init launchpad router')
webRouter.get('/launchpad', LaunchpadController.launchpadPage)