0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/api/canary/site.js
Rish dd377492bf Updated public site endpoint with more data
no issue

This adds new public settings - description, logo, brand - and some public member settings - plans, allowSelfSignup to the open site endpoint which will be used by members.js for data initialization
2020-04-21 23:35:16 +05:30

26 lines
848 B
JavaScript

const ghostVersion = require('../../lib/ghost-version');
const settingsCache = require('../../services/settings/cache');
const urlUtils = require('../../lib/url-utils');
const membersService = require('../../services/members');
const site = {
docName: 'site',
read: {
permissions: false,
query() {
return {
title: settingsCache.get('title'),
description: settingsCache.get('description'),
logo: settingsCache.get('logo'),
brand: settingsCache.get('brand'),
url: urlUtils.urlFor('home', true),
plans: membersService.config.getPublicPlans(),
allowSelfSignup: membersService.config.getPublicPlans(),
version: ghostVersion.safe
};
}
}
};
module.exports = site;