0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/web/parent/backend.js

20 lines
701 B
JavaScript
Raw Normal View History

const debug = require('@tryghost/debug')('web:backend');
const express = require('../../../shared/express');
/**
*
* @returns {import('express').RequestHandler}
*/
module.exports = () => {
debug('BackendApp setup start');
// BACKEND
// Wrap the admin and API apps into a single express app for use with vhost
const backendApp = express('backend');
backendApp.lazyUse('/ghost/api', require('../api'));
backendApp.lazyUse('/ghost/oauth', require('../oauth'));
backendApp.lazyUse('/ghost/.well-known', require('../well-known'));
backendApp.use('/ghost', require('../../services/auth/session').createSessionFromToken, require('../admin')());
return backendApp;
};