0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Add a fallback API version, allows tests to pass

- 😏
- this shouldn't really be a thing, but it's better than updating 52 tests...
This commit is contained in:
Hannah Wolfe 2019-11-08 17:24:10 +07:00
parent 3f88e7de63
commit 551e552928

View file

@ -9,6 +9,8 @@ const TaxonomyRouter = require('./TaxonomyRouter');
const PreviewRouter = require('./PreviewRouter');
const ParentRouter = require('./ParentRouter');
const defaultApiVersion = 'v3';
const registry = require('./registry');
let siteRouter;
@ -37,7 +39,8 @@ module.exports.init = (options = {start: false}) => {
registry.setRouter('siteRouter', siteRouter);
if (options.start) {
this.start(options.start);
let apiVersion = _.isBoolean(options.start) ? defaultApiVersion : options.start;
this.start(apiVersion);
}
return siteRouter.router();