Skip to content

Commit 8f4d04e

Browse files
committed
feat: add static function middleware support of basepath
1 parent d7ba00c commit 8f4d04e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/start-static-server-functions/src/staticFunctionMiddleware.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ const fetchItem = async ({
116116

117117
let result: any = staticClientCache?.get(url)
118118

119-
result = await fetch(url, {
119+
const basePath = process.env.TSS_ROUTER_BASEPATH!
120+
const prefixedUrl = path.join(basePath, url)
121+
result = await fetch(prefixedUrl, {
120122
method: 'GET',
121123
})
122124
.then((r) => r.json())

0 commit comments

Comments
 (0)