0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Updated members-api to export a router instance

no-issue

This was the original design, to make it easy to incorporate into
another application, but the URL structure in Ghost did not allow for
it, we've since learnt that the URL structure _should_ be how it is
here, so we can export a router with both the auth endpoints and the
static files for the gateway
This commit is contained in:
Fabien O'Carroll 2019-07-09 15:23:09 +08:00
parent 584d725e12
commit 34f7b2c7d6

View file

@ -217,10 +217,14 @@ module.exports = function MembersApi({
res.status(200).sendFile(require('path').join(__dirname, './gateway/bundle.js'));
});
const apiInstance = {
staticRouter,
apiRouter
};
const apiInstance = new Router();
apiInstance.use(apiRouter);
apiInstance.use('/static', staticRouter);
apiInstance.apiRouter = apiRouter;
apiInstance.staticRouter = staticRouter;
apiInstance.members = users;
apiInstance.getPublicKeys = getPublicKeys;
apiInstance.getPublicConfig = function () {