2021-11-11 15:48:36 +03:00
|
|
|
const path = require('path');
|
|
|
|
const config = require('../../../shared/config');
|
2020-04-29 18:44:27 +03:00
|
|
|
const UrlService = require('./UrlService');
|
2021-11-11 15:48:36 +03:00
|
|
|
|
|
|
|
// 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
|
2021-11-16 11:04:12 +03:00
|
|
|
const urlsCachePath = path.join(config.getContentPath('data'), 'urls.json');
|
2021-11-16 13:02:39 +03:00
|
|
|
const resourcesCachePath = path.join(config.getContentPath('data'), 'resources.json');
|
|
|
|
const urlService = new UrlService({urlsCachePath, resourcesCachePath});
|
2017-12-11 18:56:04 +03:00
|
|
|
|
|
|
|
// Singleton
|
|
|
|
module.exports = urlService;
|