Ghost/core/server/services/url/index.js
Naz 9b309cf4e7 Refactored URL cache persistance
refs https://github.com/TryGhost/Toolbox/issues/127

- This refactor is needed to accomodate incoming "resource cache" which shares a lot of common logic with how url cache is operated
2021-11-17 00:00:23 +13:00

13 lines
510 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 urlsCachePath = path.join(config.getContentPath('data'), 'urls.json');
const urlService = new UrlService({urlsCachePath});
// Singleton
module.exports = urlService;