Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Category } from '@app/modules/category/category.model';
import { Article } from '@app/modules/article/article.model';
import { Tag } from '@app/modules/tag/tag.model';
@Injectable()
export class SitemapService {
private xmlFilePath = path.format({
dir: path.join(APP_CONFIG.APP.FRONT_END_PATH, 'static'),
name: 'sitemap',
ext: '.xml',
});
private pagesMap = [
{ url: APP_CONFIG.APP.URL, changefreq: EnumChangefreq.ALWAYS, priority: 1 },
{ url: urlMap.getVlogPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
{ url: urlMap.getAboutPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
{ url: urlMap.getSitemapPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
{ url: urlMap.getGuestbookPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
];
private sitemap: Sitemap;
private sitemapCache: ICacheIoResult;
constructor(
private readonly cacheService: CacheService,
@InjectModel(Tag) private readonly tagModel: TMongooseModel,
@InjectModel(Article) private readonly articleModel: TMongooseModel<article>,
@InjectModel(Category) private readonly categoryModel: TMongooseModel,
) {
this.sitemapCache = this.cacheService.promise({
ioMode: true,</article>
import { Article } from '@app/modules/article/article.model';
import { Tag } from '@app/modules/tag/tag.model';
@Injectable()
export class SitemapService {
private xmlFilePath = path.format({
dir: path.join(APP_CONFIG.APP.FRONT_END_PATH, 'static'),
name: 'sitemap',
ext: '.xml',
});
private pagesMap = [
{ url: APP_CONFIG.APP.URL, changefreq: EnumChangefreq.ALWAYS, priority: 1 },
{ url: urlMap.getVlogPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
{ url: urlMap.getAboutPageUrl(), changefreq: EnumChangefreq.MONTHLY, priority: 1 },
{ url: urlMap.getSitemapPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
{ url: urlMap.getGuestbookPageUrl(), changefreq: EnumChangefreq.ALWAYS, priority: 1 },
];
private sitemap: Sitemap;
private sitemapCache: ICacheIoResult;
constructor(
private readonly cacheService: CacheService,
@InjectModel(Tag) private readonly tagModel: TMongooseModel,
@InjectModel(Article) private readonly articleModel: TMongooseModel<article>,
@InjectModel(Category) private readonly categoryModel: TMongooseModel,
) {
this.sitemapCache = this.cacheService.promise({
ioMode: true,
key: CACHE_KEY.SITEMAP,</article>