From f25c9aaa371c4d8effa084a860219864ef1ec0d5 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Fri, 8 Mar 2024 10:03:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index a7e7ea3..246eea3 100644 --- a/index.ts +++ b/index.ts @@ -25,8 +25,11 @@ scheduleJob("*/15 * * * *", main); scheduleJob("0 10 * * 5", manageRobot.sendRobotMsg); Bun.serve({ - async fetch() { - await manageRobot.sendRobotMsg(); + async fetch(req) { + const url = new URL(req.url); + if (url.pathname === '/ci') { + await manageRobot.sendRobotMsg(); + } return new Response("OK"); }, port: 3000,