mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
bab5764179
- Reduced the number of levels in our debug naming in the frontend - Unified components like "themes" and "routing" under one name - Should help to make debug slightly more useful again
26 lines
809 B
JavaScript
26 lines
809 B
JavaScript
const debug = require('@tryghost/debug')('frontend');
|
|
const express = require('../../../shared/express');
|
|
|
|
const shared = require('../shared');
|
|
|
|
/**
|
|
*
|
|
* @param {object} options
|
|
* @returns {import('express').RequestHandler}
|
|
*/
|
|
module.exports = (options) => {
|
|
debug('FrontendApp setup start', options);
|
|
|
|
// 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 client.
|
|
frontendApp.use(shared.middlewares.urlRedirects.frontendSSLRedirect);
|
|
|
|
frontendApp.use('/members', require('../members')());
|
|
frontendApp.use('/', require('../site')(options));
|
|
|
|
return frontendApp;
|
|
};
|