Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/keyserver.js
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | const setupAppRouter = router => { | ||||
'/download_error_report/:reportID', | '/download_error_report/:reportID', | ||||
downloadHandler(errorReportDownloadResponder), | downloadHandler(errorReportDownloadResponder), | ||||
); | ); | ||||
router.get( | router.get( | ||||
'/upload/:uploadID/:secret', | '/upload/:uploadID/:secret', | ||||
downloadHandler(uploadDownloadResponder), | downloadHandler(uploadDownloadResponder), | ||||
); | ); | ||||
// This endpoint should be handled by the mobile app. If the server | |||||
// receives this request, it means that the app is not installed and we | |||||
// should redirect the user to a place from which the app can be | |||||
// downloaded. | |||||
router.get('/invite/:secret', inviteResponder); | |||||
// $FlowFixMe express-ws has side effects that can't be typed | // $FlowFixMe express-ws has side effects that can't be typed | ||||
router.ws('/ws', onConnection); | router.ws('/ws', onConnection); | ||||
router.get('/worker/:worker', webWorkerResponder); | router.get('/worker/:worker', webWorkerResponder); | ||||
router.get('*', htmlHandler(websiteResponder)); | router.get('*', htmlHandler(websiteResponder)); | ||||
router.post( | router.post( | ||||
'/upload_multimedia', | '/upload_multimedia', | ||||
multerProcessor, | multerProcessor, | ||||
Show All 16 Lines | if (landingBaseRoutePath) { | ||||
express.static('landing_compiled', compiledFolderOptions), | express.static('landing_compiled', compiledFolderOptions), | ||||
); | ); | ||||
landingRouter.use('/', express.static('landing_icons')); | landingRouter.use('/', express.static('landing_icons')); | ||||
landingRouter.post('/subscribe_email', emailSubscriptionResponder); | landingRouter.post('/subscribe_email', emailSubscriptionResponder); | ||||
landingRouter.get('*', landingHandler); | landingRouter.get('*', landingHandler); | ||||
server.use(landingBaseRoutePath, landingRouter); | server.use(landingBaseRoutePath, landingRouter); | ||||
} | } | ||||
// This endpoint should be handled by the mobile app. If the server | |||||
// receives this request, it means that the app is not installed and we | |||||
// should redirect the user to a place from which the app can be | |||||
// downloaded. | |||||
server.get('/invite/:secret', inviteResponder); | |||||
if (commAppBaseRoutePath) { | if (commAppBaseRoutePath) { | ||||
const commAppRouter = express.Router(); | const commAppRouter = express.Router(); | ||||
setupAppRouter(commAppRouter); | setupAppRouter(commAppRouter); | ||||
server.use(commAppBaseRoutePath, commAppRouter); | server.use(commAppBaseRoutePath, commAppRouter); | ||||
} | } | ||||
if (squadCalBaseRoutePath) { | if (squadCalBaseRoutePath) { | ||||
const squadCalRouter = express.Router(); | const squadCalRouter = express.Router(); | ||||
Show All 17 Lines |