remove log
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/local-proxy",
|
"name": "@kevisual/local-proxy",
|
||||||
"version": "0.0.6",
|
"version": "0.0.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pathname.startsWith('/client') || pathname.startsWith('/api') || pathname.startsWith('/v1') || pathname.startsWith('/serve')) {
|
if (pathname.startsWith('/client') || pathname.startsWith('/api') || pathname.startsWith('/v1') || pathname.startsWith('/serve')) {
|
||||||
console.debug('handle by router');
|
// console.debug('handle by router');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const localProxyProxyList = localProxy.getLocalProxyList();
|
const localProxyProxyList = localProxy.getLocalProxyList();
|
||||||
|
|||||||
@@ -24,11 +24,15 @@ export const fileProxy = (req: http.IncomingMessage, res: http.ServerResponse, p
|
|||||||
filePath = path.join(rootPath, target, pathname);
|
filePath = path.join(rootPath, target, pathname);
|
||||||
exist = checkFileExists(filePath, true);
|
exist = checkFileExists(filePath, true);
|
||||||
}
|
}
|
||||||
|
if (!exist) {
|
||||||
|
filePath = path.join(rootPath, target, pathname, 'index.html');
|
||||||
|
exist = checkFileExists(filePath, true);
|
||||||
|
}
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
filePath = path.join(rootPath, target, indexPath);
|
filePath = path.join(rootPath, target, indexPath);
|
||||||
exist = checkFileExists(filePath, true);
|
exist = checkFileExists(filePath, true);
|
||||||
}
|
}
|
||||||
log.debug('filePath', { filePath, exist });
|
// log.debug('filePath', { filePath, exist });
|
||||||
|
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
res.statusCode = 404;
|
res.statusCode = 404;
|
||||||
|
|||||||
Reference in New Issue
Block a user