mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 06:12:03 +03:00
fa4e68ba13
no issue - adds abolsute->relative and relative->absolute transformer methods to card definitions - allows for each card to tailor it's transformation to the specific needs of it's payload so that the `mobiledoc` field can be transformed successfully during API serialization/deserialization
16 lines
471 B
JavaScript
16 lines
471 B
JavaScript
const UrlUtils = require('@tryghost/url-utils');
|
|
const config = require('../../config');
|
|
const cards = require('../mobiledoc/cards');
|
|
|
|
const urlUtils = new UrlUtils({
|
|
url: config.get('url'),
|
|
adminUrl: config.get('admin:url'),
|
|
apiVersions: config.get('api:versions'),
|
|
slugs: config.get('slugs').protected,
|
|
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
|
baseApiPath: '/ghost/api',
|
|
cardTransformers: cards
|
|
});
|
|
|
|
module.exports = urlUtils;
|