Adjust pulling in config

This commit is contained in:
Owen 2025-08-12 16:47:59 -07:00
parent 880a123149
commit 3d8869066a
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
6 changed files with 26 additions and 32 deletions

View file

@ -17,20 +17,8 @@ export const proxyToRemote = async (
endpoint: string
): Promise<any> => {
try {
const remoteConfig = config.getRawConfig().hybrid;
if (!remoteConfig?.endpoint) {
logger.error("Remote endpoint not configured in hybrid.endpoint config");
return next(
createHttpError(
HttpCode.INTERNAL_SERVER_ERROR,
"Remote endpoint not configured"
)
);
}
const remoteUrl = `${config.getRawConfig().hybrid?.endpoint?.replace(/\/$/, '')}/api/v1/${endpoint}`;
const remoteUrl = `${remoteConfig.endpoint.replace(/\/$/, '')}/api/v1/${endpoint}`;
logger.debug(`Proxying request to remote server: ${remoteUrl}`);
// Forward the request to the remote server