mirror of
https://github.com/sune-org/ORP.git
synced 2026-01-14 00:27:59 +00:00
Fix: Use NTFY_URL env var instead of NTFY_TOPIC
This commit is contained in:
5
index.js
5
index.js
@@ -92,7 +92,7 @@ export class MyDurableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
notify(msg, pri = 3, tags = []) {
|
notify(msg, pri = 3, tags = []) {
|
||||||
if (!this.env.NTFY_TOPIC) return;
|
if (!this.env.NTFY_URL) return;
|
||||||
const attachment = this.getConversationText();
|
const attachment = this.getConversationText();
|
||||||
const headers = { Title: 'Sune ORP', Priority: `${pri}`, Tags: tags.join(',') };
|
const headers = { Title: 'Sune ORP', Priority: `${pri}`, Tags: tags.join(',') };
|
||||||
let body = msg;
|
let body = msg;
|
||||||
@@ -102,7 +102,7 @@ export class MyDurableObject {
|
|||||||
headers['Content-Type'] = 'text/markdown';
|
headers['Content-Type'] = 'text/markdown';
|
||||||
body = attachment;
|
body = attachment;
|
||||||
}
|
}
|
||||||
this.state.waitUntil(fetch(`https://ntfy.sh/${this.env.NTFY_TOPIC}`, {
|
this.state.waitUntil(fetch(this.env.NTFY_URL, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body,
|
body,
|
||||||
headers,
|
headers,
|
||||||
@@ -442,4 +442,3 @@ export class MyDurableObject {
|
|||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user