0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/web/parent/frontend.js
Hannah Wolfe 8ec8a21b71
Renamed "client" references to "admin"
refs: https://github.com/TryGhost/Toolbox/issues/299

- renamed lots of things that reference Ghost admin as "client"
- these things make even less sense in a post core/client world
2022-05-17 09:05:44 +01:00

24 lines
906 B
JavaScript

const debug = require('@tryghost/debug')('frontend');
const express = require('../../../shared/express');
const shared = require('../shared');
/**
*
* @param {import('../../../frontend/services/routing/router-manager').RouterConfig} routerConfig
* @returns {import('express').RequestHandler}
*/
module.exports = (routerConfig) => {
debug('FrontendApp setup start', routerConfig);
// FRONTEND
const frontendApp = express('frontend');
// Force SSL if blog url is set to https. The redirects handling must happen before asset and page routing,
// otherwise we serve assets/pages with http. This can cause mixed content warnings in the admin app.
frontendApp.use(shared.middleware.urlRedirects.frontendSSLRedirect);
frontendApp.lazyUse('/members', require('../members'));
frontendApp.use('/', require('../../../frontend/web')(routerConfig));
return frontendApp;
};