Files
kt-financial-system/apps/backend/utils/media-storage.ts
2025-11-04 16:06:44 +08:00

16 lines
349 B
TypeScript

import { mkdirSync } from 'node:fs';
import { join } from 'pathe';
const MEDIA_ROOT = join(process.cwd(), 'storage', 'telegram-media');
mkdirSync(MEDIA_ROOT, { recursive: true });
export function getMediaRoot() {
return MEDIA_ROOT;
}
export function resolveMediaAbsolutePath(relativePath: string) {
return join(MEDIA_ROOT, relativePath);
}