From 5bbd099bddc116f5b58bada0348a720f0a9cec1e Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 4 Sep 2023 21:11:57 +0200 Subject: [PATCH] Fix endpoint support --- plugos/hooks/endpoint.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugos/hooks/endpoint.ts b/plugos/hooks/endpoint.ts index 7b1e499a..071c57e7 100644 --- a/plugos/hooks/endpoint.ts +++ b/plugos/hooks/endpoint.ts @@ -49,8 +49,8 @@ export class EndpointHook implements Hook { continue; } const functions = manifest.functions; - console.log("Checking plug", plugName); - const prefix = `${this.prefix}/${plugName}`; + // console.log("Checking plug", plugName); + const prefix = `${this.prefix}${plugName}`; if (!requestPath.startsWith(prefix)) { continue; } @@ -58,11 +58,11 @@ export class EndpointHook implements Hook { if (!functionDef.http) { continue; } - console.log("Got config", functionDef); + // console.log("Got config", functionDef); const endpoints = Array.isArray(functionDef.http) ? functionDef.http : [functionDef.http]; - console.log(endpoints); + // console.log(endpoints); for (const { path, method } of endpoints) { const prefixedPath = `${prefix}${path}`; if ( @@ -92,7 +92,7 @@ export class EndpointHook implements Hook { } ctx.response.status = response.status; ctx.response.body = response.body; - console.log("Sent result"); + // console.log("Sent result"); return; } catch (e: any) { console.error("Error executing function", e);