Ghost/core/shared/url-utils.js

19 lines
574 B
JavaScript
Raw Normal View History

const UrlUtils = require('@tryghost/url-utils');
const config = require('./config');
const BASE_API_PATH = '/ghost/api';
const urlUtils = new UrlUtils({
getSubdir: config.getSubdir,
getSiteUrl: config.getSiteUrl,
getAdminUrl: config.getAdminUrl,
apiVersions: config.get('api:versions'),
defaultApiVersion: config.get('api:versions:default'),
slugs: config.get('slugs').protected,
redirectCacheMaxAge: config.get('caching:301:maxAge'),
baseApiPath: BASE_API_PATH
});
module.exports = urlUtils;
module.exports.BASE_API_PATH = BASE_API_PATH;