mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
65f16f77a7
no-issue This is not used by any current apps, and apps are considered deprecated.
28 lines
977 B
JavaScript
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)
|
|
}
|
|
};
|
|
};
|