mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-13 11:36:04 +00:00
Adjust pulling in config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user