2019-06-18 08:13:55 -05:00
|
|
|
const UrlUtils = require('@tryghost/url-utils');
|
2020-05-28 05:57:02 -05:00
|
|
|
const config = require('./config');
|
2019-06-18 08:13:55 -05:00
|
|
|
|
|
|
|
const urlUtils = new UrlUtils({
|
2021-06-17 08:05:30 -05:00
|
|
|
getSubdir: config.getSubdir,
|
|
|
|
getSiteUrl: config.getSiteUrl,
|
|
|
|
getAdminUrl: config.getAdminUrl,
|
2019-06-18 08:13:55 -05:00
|
|
|
apiVersions: config.get('api:versions'),
|
2021-04-21 08:57:07 -05:00
|
|
|
defaultApiVersion: config.get('api:versions:default'),
|
2019-06-18 08:13:55 -05:00
|
|
|
slugs: config.get('slugs').protected,
|
|
|
|
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
2021-05-25 15:13:50 -05:00
|
|
|
baseApiPath: '/ghost/api'
|
2019-06-18 08:13:55 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = urlUtils;
|