mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Removed members internal app (#10379)
no-issue * Mounted members static router directly to parentApp * Removed members internal app
This commit is contained in:
parent
909f9012ed
commit
42a1313bff
@ -1,12 +0,0 @@
|
||||
const membersService = require('../../services/members');
|
||||
const labs = require('../../services/labs');
|
||||
|
||||
module.exports = {
|
||||
activate() {},
|
||||
|
||||
setupMiddleware(router) {
|
||||
if (labs.isSet('members')) {
|
||||
router.use('/members', membersService.api.staticRouter);
|
||||
}
|
||||
}
|
||||
};
|
@ -17,8 +17,7 @@
|
||||
"internal": [
|
||||
"private-blogging",
|
||||
"subscribers",
|
||||
"amp",
|
||||
"members"
|
||||
"amp"
|
||||
]
|
||||
},
|
||||
"slugs": {
|
||||
|
@ -4,6 +4,8 @@ const config = require('../config');
|
||||
const compress = require('compression');
|
||||
const netjet = require('netjet');
|
||||
const shared = require('./shared');
|
||||
const labs = require('../services/labs');
|
||||
const membersService = require('../services/members');
|
||||
|
||||
module.exports = function setupParentApp(options = {}) {
|
||||
debug('ParentApp setup start');
|
||||
@ -46,6 +48,11 @@ module.exports = function setupParentApp(options = {}) {
|
||||
// ADMIN
|
||||
parentApp.use('/ghost', require('./admin')());
|
||||
|
||||
// MEMBERS
|
||||
if (labs.isSet('members')) {
|
||||
parentApp.use('/members', membersService.api.staticRouter);
|
||||
}
|
||||
|
||||
// BLOG
|
||||
parentApp.use(require('./site')(options));
|
||||
|
||||
|
@ -47,15 +47,14 @@ describe('Apps', function () {
|
||||
settingsEditStub.callCount.should.eql(0);
|
||||
|
||||
// Test that activate is called 4 times, and install 0 time
|
||||
loaderActivateStub.callCount.should.eql(4);
|
||||
loaderActivateStub.callCount.should.eql(3);
|
||||
loaderInstallStub.callCount.should.eql(0);
|
||||
|
||||
// Test that the 4 internal apps are loaded as expected
|
||||
availableApps.should.be.an.Array().with.lengthOf(4);
|
||||
availableApps.should.be.an.Array().with.lengthOf(3);
|
||||
availableApps.should.containEql('amp');
|
||||
availableApps.should.containEql('private-blogging');
|
||||
availableApps.should.containEql('subscribers');
|
||||
availableApps.should.containEql('members');
|
||||
|
||||
done();
|
||||
})
|
||||
@ -81,15 +80,14 @@ describe('Apps', function () {
|
||||
settingsEditStub.firstCall.args[0].settings[0].value.should.eql(['testA', 'testB']);
|
||||
|
||||
// Test that activate is called 6 times, and install only 1 time
|
||||
loaderActivateStub.callCount.should.eql(6);
|
||||
loaderActivateStub.callCount.should.eql(5);
|
||||
loaderInstallStub.callCount.should.eql(1);
|
||||
|
||||
// Test that the 4 internal apps are loaded as expected
|
||||
availableApps.should.be.an.Array().with.lengthOf(6);
|
||||
// Test that the 5 internal apps are loaded as expected
|
||||
availableApps.should.be.an.Array().with.lengthOf(5);
|
||||
availableApps.should.containEql('amp');
|
||||
availableApps.should.containEql('private-blogging');
|
||||
availableApps.should.containEql('subscribers');
|
||||
availableApps.should.containEql('members');
|
||||
availableApps.should.containEql('testA');
|
||||
availableApps.should.containEql('testB');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user