mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Added alias for non-versioned API endpoints
refs https://github.com/TryGhost/Toolbox/issues/169 - Before next major version release we need to prepare for removal of API versioning. - This change allows unversioned API requests to work under following endpoints: - /ghost/api/admin - /ghost/api/content - This change should allow further preparation of the API clients (SDKs, Integrations, etc.) to non-versioned APIs in Ghost instances in ^5.0.0 - Changed default e2e test targets to non-versioned API. It's a trial, to have working examples. In the future all tests should switch to use only non-versioned endpoints.
This commit is contained in:
parent
cd1183c9d8
commit
da0dee548c
@ -25,6 +25,9 @@ module.exports = function setupApiApp() {
|
||||
apiApp.lazyUse(urlUtils.getVersionPath({version: 'canary', type: 'content'}), require('./canary/content/app'));
|
||||
apiApp.lazyUse(urlUtils.getVersionPath({version: 'canary', type: 'admin'}), require('./canary/admin/app'));
|
||||
|
||||
apiApp.lazyUse('/content/', require('./canary/content/app'));
|
||||
apiApp.lazyUse('/admin/', require('./canary/admin/app'));
|
||||
|
||||
// Error handling for requests to non-existent API versions
|
||||
apiApp.use(errorHandler.resourceNotFound);
|
||||
apiApp.use(errorHandler.handleJSONResponse(sentry));
|
||||
|
@ -7,7 +7,7 @@ const testUtils = require('../../utils');
|
||||
// the commit introducing this comment.
|
||||
const schema = require('../../../core/server/data/schema').tables;
|
||||
|
||||
const API_URL = '/ghost/api/canary/admin/';
|
||||
const API_URL = '/ghost/api/admin/';
|
||||
|
||||
const expectedProperties = {
|
||||
// API top level
|
||||
|
@ -2,7 +2,7 @@ const url = require('url');
|
||||
const _ = require('lodash');
|
||||
const testUtils = require('../../utils');
|
||||
|
||||
const API_URL = '/ghost/api/canary/content/';
|
||||
const API_URL = '/ghost/api/content/';
|
||||
|
||||
const expectedProperties = {
|
||||
// API top level
|
||||
|
Loading…
Reference in New Issue
Block a user