diff --git a/core/server/public/members.js b/core/server/public/members.js index 4288420780..2f61b862d6 100644 --- a/core/server/public/members.js +++ b/core/server/public/members.js @@ -1 +1 @@ -MembersThemeBindings.init({ssrUrl: "{{blog-url}}/members/ssr", membersUrl: "{{blog-url}}/members"}); +MembersThemeBindings.init({ssrUrl: "{{blog-url}}/members/ssr", membersUrl: "{{admin-url}}/members"}); diff --git a/core/server/web/parent-app.js b/core/server/web/parent-app.js index b251f55e61..61befab68f 100644 --- a/core/server/web/parent-app.js +++ b/core/server/web/parent-app.js @@ -45,13 +45,13 @@ module.exports = function setupParentApp(options = {}) { // @TODO: finish refactoring the API app parentApp.use('/ghost/api', require('./api')()); + // MEMBERS + parentApp.use('/ghost/members', labs.members, membersService.gateway); + parentApp.use('/ghost/members/auth', labs.members, membersService.authPages); + // ADMIN parentApp.use('/ghost', require('./admin')()); - // MEMBERS - parentApp.use('/members', labs.members, membersService.gateway); - parentApp.use('/members/auth', labs.members, membersService.authPages); - // BLOG parentApp.use(require('./site')(options)); diff --git a/core/server/web/shared/middlewares/serve-public-file.js b/core/server/web/shared/middlewares/serve-public-file.js index ee391f6ba8..708ac3cbf0 100644 --- a/core/server/web/shared/middlewares/serve-public-file.js +++ b/core/server/web/shared/middlewares/serve-public-file.js @@ -9,6 +9,7 @@ function createPublicFileMiddleware(file, type, maxAge) { const publicFilePath = config.get('paths').publicFilePath; const filePath = file.match(/^public/) ? path.join(publicFilePath, file.replace(/^public/, '')) : path.join(publicFilePath, file); const blogRegex = /(\{\{blog-url\}\})/g; + const adminRegex = /(\{\{admin-url\}\})/g; const apiRegex = /(\{\{api-url\}\})/g; return function servePublicFile(req, res, next) { @@ -26,6 +27,7 @@ function createPublicFileMiddleware(file, type, maxAge) { if (type === 'text/xsl' || type === 'text/plain' || type === 'application/javascript') { str = str.replace(blogRegex, urlUtils.urlFor('home', true).replace(/\/$/, '')); str = str.replace(apiRegex, urlUtils.urlFor('api', {cors: true, version: 'v0.1', versionType: 'content'}, true)); + str = str.replace(adminRegex, urlUtils.urlFor('admin', true).replace(/\/$/, '')); } content = {