diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js --- a/keyserver/src/keyserver.js +++ b/keyserver/src/keyserver.js @@ -127,6 +127,13 @@ // and prevent commAppRouter and landingRouter from working correctly. So we // make sure that squadCalRouter goes last + // 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. It's important to define it before any other router so that + // it won't get handled by e.g. `/` rule. + server.get('/invite/:secret', inviteResponder); + if (landingBaseRoutePath) { const landingRouter = express.Router(); landingRouter.use('/images', express.static('images')); @@ -141,12 +148,6 @@ 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) { const commAppRouter = express.Router(); setupAppRouter(commAppRouter);