Ghost/core/server/services/url/index.js
Naz 4582fd48b5 Parameterized url cache storage path
refs https://github.com/TryGhost/Toolbox/issues/116

- This should allow testing in a bit easier manner and would place the file into a more suitable directory
- ideally we'd put an alfa flag bahind this new "cached routes" feature to have less consequences to deal with if we have to back out
2021-11-13 01:01:28 +13:00

13 lines
508 B
JavaScript

const path = require('path');
const config = require('../../../shared/config');
const UrlService = require('./UrlService');
// NOTE: instead of a path we could give UrlService a "data-resolver" of some sort
// so it doesn't have to contain the logic to read data at all. This would be
// a possible improvement in the future
const urlCachePath = path.join(config.getContentPath('data'), 'urls.json');
const urlService = new UrlService({urlCachePath});
// Singleton
module.exports = urlService;