diff --git a/core/server/api/configuration.js b/core/server/api/configuration.js index beaafc13f4..a3af1b2514 100644 --- a/core/server/api/configuration.js +++ b/core/server/api/configuration.js @@ -5,6 +5,7 @@ var Promise = require('bluebird'), urlService = require('../services/url'), models = require('../models'), config = require('../config'), + labs = require('../services/labs'), settingsCache = require('../services/settings/cache'), ghostVersion = require('../lib/ghost-version'), configuration; @@ -26,7 +27,7 @@ function getAboutConfig() { function getBaseConfig() { return { useGravatar: !config.isPrivacyDisabled('useGravatar'), - publicAPI: config.get('publicAPI') === true, + publicAPI: labs.isSet('publicAPI'), blogUrl: urlService.utils.urlFor('home', true), blogTitle: settingsCache.get('title'), clientExtensions: config.get('clientExtensions'), diff --git a/core/test/integration/api/api_configuration_spec.js b/core/test/integration/api/api_configuration_spec.js index d82deec702..3aa46a2c14 100644 --- a/core/test/integration/api/api_configuration_spec.js +++ b/core/test/integration/api/api_configuration_spec.js @@ -9,7 +9,7 @@ var should = require('should'), describe('Configuration API', function () { // Keep the DB clean before(testUtils.teardown); - beforeEach(testUtils.setup('clients')); + beforeEach(testUtils.setup('clients', 'settings')); afterEach(function () { configUtils.restore(); return testUtils.teardown(); @@ -29,7 +29,7 @@ describe('Configuration API', function () { props.blogUrl.should.eql('http://127.0.0.1:2369/'); props.useGravatar.should.eql(false); - props.publicAPI.should.eql(false); + props.publicAPI.should.eql(true); props.clientId.should.eql('ghost-admin'); props.clientSecret.should.eql('not_available');