mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
c2793eedd3
no issue Our server-defined `mobiledoc` object was required by `UrlUtils.cardTransformers` property to help set up a shortcut for url transform functions but that was breaking the independence of `UrlUtils` by crossing the shared/server boundary. - `cardTransformers` is only needed for the `mobiledocToTransformReady` utility function that will only be used by the server - removed `UrlUtils.cardTransformers` (and associated require) from our `UrlUtils` instance and updated the few areas the server uses `mobiledocToTransformReady()` to pass in the mobiledoc card objects directly as an option
15 lines
452 B
JavaScript
15 lines
452 B
JavaScript
const UrlUtils = require('@tryghost/url-utils');
|
|
const config = require('./config');
|
|
|
|
const urlUtils = new UrlUtils({
|
|
url: config.get('url'),
|
|
adminUrl: config.get('admin:url'),
|
|
apiVersions: config.get('api:versions'),
|
|
defaultApiVersion: config.get('api:versions:default'),
|
|
slugs: config.get('slugs').protected,
|
|
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
|
baseApiPath: '/ghost/api'
|
|
});
|
|
|
|
module.exports = urlUtils;
|