diff --git a/assistant/src/module/local-proxy/package.json b/assistant/src/module/local-proxy/package.json index a9c9900..4818639 100644 --- a/assistant/src/module/local-proxy/package.json +++ b/assistant/src/module/local-proxy/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/local-proxy", - "version": "0.0.6", + "version": "0.0.8", "description": "", "main": "index.ts", "scripts": { diff --git a/assistant/src/module/local-proxy/proxy.ts b/assistant/src/module/local-proxy/proxy.ts index 3af27d9..18682ab 100644 --- a/assistant/src/module/local-proxy/proxy.ts +++ b/assistant/src/module/local-proxy/proxy.ts @@ -23,7 +23,7 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp return; } if (pathname.startsWith('/client') || pathname.startsWith('/api') || pathname.startsWith('/v1') || pathname.startsWith('/serve')) { - console.debug('handle by router'); + // console.debug('handle by router'); return; } const localProxyProxyList = localProxy.getLocalProxyList(); diff --git a/assistant/src/module/local-proxy/proxy/file-proxy.ts b/assistant/src/module/local-proxy/proxy/file-proxy.ts index ea04cac..459a746 100644 --- a/assistant/src/module/local-proxy/proxy/file-proxy.ts +++ b/assistant/src/module/local-proxy/proxy/file-proxy.ts @@ -24,11 +24,15 @@ export const fileProxy = (req: http.IncomingMessage, res: http.ServerResponse, p filePath = path.join(rootPath, target, pathname); exist = checkFileExists(filePath, true); } + if (!exist) { + filePath = path.join(rootPath, target, pathname, 'index.html'); + exist = checkFileExists(filePath, true); + } if (!exist) { filePath = path.join(rootPath, target, indexPath); exist = checkFileExists(filePath, true); } - log.debug('filePath', { filePath, exist }); + // log.debug('filePath', { filePath, exist }); if (!exist) { res.statusCode = 404;