mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-21 17:58:27 +02:00
Adjust pulling in config
This commit is contained in:
parent
880a123149
commit
3d8869066a
6 changed files with 26 additions and 32 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue