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