From e6ac8052dfc552e516cc40ddabd8bb745cce9dff Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 15 Dec 2025 19:06:58 -0800 Subject: [PATCH] Refactor: Replace NTFY_TOPIC with NTFY_URL for flexible notifications --- functions/api/links/create.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/links/create.js b/functions/api/links/create.js index 1b44292..bfd0475 100644 --- a/functions/api/links/create.js +++ b/functions/api/links/create.js @@ -7,10 +7,10 @@ const RESERVED = new Set([ "robots","sitemap","favicon","well-known","assets","static","img","js","css","public" ]); const ntfy = (env,title,msg,slug,user,p=3) => { - if(!env.NTFY_TOPIC) return Promise.resolve(); + if(!env.NTFY_URL) return Promise.resolve(); const origin = "https://4ev.link"; const actions = `view, Seize, ${origin}/admin?slug=${slug}; view, Ban User, ${origin}/admin?user=${user}`; - return fetch(`https://ntfy.sh/${env.NTFY_TOPIC}`,{ + return fetch(env.NTFY_URL,{ method:"POST", headers:{ "Title":`🔔 ${title}`,