feat: 优化路径匹配逻辑 & 打印入口路由
All checks were successful
CI Monitor MIflow / build-image (push) Successful in 45s

This commit is contained in:
zhaoyingbo 2024-08-09 01:11:54 +00:00
parent 8d6e8a2844
commit 5903c7ee94

View File

@ -12,10 +12,10 @@ const PREFIX = "/gitlab_monitor"
const server = Bun.serve({
async fetch(req) {
try {
// 打印当前路由
console.log("🚀 ~ serve ~ req.url", req.url)
// 路由处理
const { exactCheck } = makeCheckPathTool(req.url, PREFIX)
// 非根路径
if (!exactCheck("/")) console.log("🚀 ~ serve ~ req.url", req.url)
// CI 监控
if (exactCheck("/ci")) return manageCIMonitorReq(req)
// Gitlab 事件