0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/services/apps/proxy.js
Fabien O'Carroll 65f16f77a7 Removed unused api object from apps proxy
no-issue

This is not used by any current apps, and apps are considered deprecated.
2019-04-16 11:05:33 +02:00

28 lines
977 B
JavaScript

const helpers = require('../../helpers/register');
const filters = require('../../filters');
const common = require('../../lib/common');
const routingService = require('../routing');
module.exports.getInstance = function getInstance(name) {
if (!name) {
throw new Error(common.i18n.t('errors.apps.mustProvideAppName.error'));
}
const appRouter = routingService.registry.getRouter('appRouter');
return {
filters: {
register: filters.registerFilter.bind(filters),
deregister: filters.deregisterFilter.bind(filters)
},
helpers: {
register: helpers.registerThemeHelper.bind(helpers),
registerAsync: helpers.registerAsyncThemeHelper.bind(helpers)
},
// Expose the route service...
routeService: {
// This allows for mounting an entirely new Router at a path...
registerRouter: appRouter.mountRouter.bind(appRouter)
}
};
};