From 7b5945c0f4c69ac60d00b7701f4ac90b612e8335 Mon Sep 17 00:00:00 2001 From: Savas Vedova Date: Mon, 25 Mar 2024 10:06:33 +0300 Subject: [PATCH] chore: use absolute path --- src/utils/callbacks/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/callbacks/api.ts b/src/utils/callbacks/api.ts index c0d18e9..f159a25 100644 --- a/src/utils/callbacks/api.ts +++ b/src/utils/callbacks/api.ts @@ -60,7 +60,7 @@ export const handleApi = ( // This is what we do here: // /api/my-path?query-param => /my-path const requestPath = - req.url?.split(/[\?#]/)[0].split("/").slice(2).join("/") || "/"; + "/" + (req.url?.split(/[\?#]/)[0].split("/").slice(2).join("/") || ""); const file = matchPath(cachedFiles, requestPath, req.method);