mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 16:56:39 +00:00
Adjust pulling in config
This commit is contained in:
@@ -147,6 +147,10 @@ export class Config {
|
||||
return false;
|
||||
}
|
||||
|
||||
public isHybridMode() {
|
||||
return this.rawConfig?.hybrid;
|
||||
}
|
||||
|
||||
public async checkSupporterKey() {
|
||||
const [key] = await db.select().from(supporterKey).limit(1);
|
||||
|
||||
|
||||
@@ -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