Skip to content

Commit 772498e

Browse files
feat: 添加404请求的控制台日志打印
- 当请求路径不匹配任何路由时,在控制台打印404日志 - 格式为: 404 - [HTTP方法] [路径] - 便于调试和监控未匹配的请求
1 parent 4222367 commit 772498e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

deno-proxy/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,5 +280,6 @@ serve((req) => {
280280
return handleTokenCount(req, requestId);
281281
}
282282

283+
console.log(`404 - ${req.method} ${url.pathname}`);
283284
return new Response("Not Found", { status: 404 });
284285
}, config.autoPort ? undefined : { hostname: config.host, port: config.port });

0 commit comments

Comments
 (0)