From d811f76b1242574f5051d057fd2723edd085c1ad Mon Sep 17 00:00:00 2001 From: Herman Bremnes <37117219+bernes1@users.noreply.github.com> Date: Tue, 12 Sep 2023 06:19:08 +0200 Subject: [PATCH] add ntffy (#17) --- src/ntfy.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/ntfy.js diff --git a/src/ntfy.js b/src/ntfy.js new file mode 100644 index 0000000..ece1849 --- /dev/null +++ b/src/ntfy.js @@ -0,0 +1,27 @@ +import dotenv from 'dotenv'; +dotenv.config(); + +let ntfyUrl = process.env.NTFY_URL; + +export function sendNtfyOpen() { + let message = "Hackeriet is Open" + fetch(ntfyUrl,{ + method: "POST", + headers: { + "Content-Type": "application/json", + }, + + body: message + },) +} + +export function sendNtfyClosed() { + let message = "Hackeriet is Closed" + fetch( ntfyUrl,{ + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: message + },) +}