backend: update path resolution for public files to use project root

This commit is contained in:
Carlos Santos 2025-05-14 12:24:41 +02:00
parent d2d3453f35
commit 12bbd7b4e8

View File

@ -4,11 +4,11 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Path to the source code
const srcPath = path.resolve(__dirname, '..');
// Find project root (assuming backend is always in <root>/backend)
const projectRoot = path.resolve(__dirname, '../../..');
export const publicFilesPath = path.join(srcPath, '../public');
export const webcomponentBundlePath = path.join(srcPath, '../public/webcomponent/openvidu-meet.bundle.min.js');
export const publicFilesPath = path.join(projectRoot, 'backend/public');
export const webcomponentBundlePath = path.join(publicFilesPath, 'webcomponent/openvidu-meet.bundle.min.js');
export const indexHtmlPath = path.join(publicFilesPath, 'index.html');
export const publicApiHtmlFilePath = path.join(publicFilesPath, 'openapi', 'public.html');
export const internalApiHtmlFilePath = path.join(publicFilesPath, 'openapi', 'internal.html');