0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Wired up Offer redirects to the site app

refs https://github.com/TryGhost/Team/issues/1091

This piece of middleware will handle redirecting from offer codes to the
relavant portal URL.
This commit is contained in:
Fabien O'Carroll 2021-10-05 13:18:18 +02:00 committed by Fabien 'egg' O'Carroll
parent 3742a4afb7
commit 561ef348c9

View file

@ -16,6 +16,7 @@ const appService = require('../../../frontend/services/apps');
const themeEngine = require('../../../frontend/services/theme-engine');
const themeMiddleware = themeEngine.middleware;
const membersService = require('../../services/members');
const offersService = require('../../services/offers');
const siteRoutes = require('./routes');
const shared = require('../shared');
const mw = require('./middleware');
@ -84,6 +85,8 @@ module.exports = function setupSiteApp(options = {}) {
// enable CORS headers (allows admin client to hit front-end when configured on separate URLs)
siteApp.use(cors(corsOptionsDelegate));
siteApp.use(offersService.middleware);
// you can extend Ghost with a custom redirects file
// see https://github.com/TryGhost/Ghost/issues/7707
shared.middlewares.customRedirects.use(siteApp);