nodejs.md

Node.js

Uses the built-in https module — no third-party dependencies required. Run each example as a standalone script.

Examples

Normal success

const https = require("https");
const req = https.request(
  `https://ntfy.sh/${process.env.NTFY_TOPIC_LLM}`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.NTFY_ACCESS_TOKEN}`,
      Title: "Refactored authentication middleware in rumilo",
      Tags: "hammer_and_wrench",
    },
  },
  (res) => res.resume()
);
req.end(
  "Finished refactoring the auth middleware in rumilo. Session validation is cleaner now and all tests pass."
);

Success with a relevant click URL

const https = require("https");
const req = https.request(
  `https://ntfy.sh/${process.env.NTFY_TOPIC_LLM}`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.NTFY_ACCESS_TOKEN}`,
      Title: "Updated AUR package for kagi-ken",
      Tags: "package",
      Click: "https://aur.archlinux.org/packages/kagi-ken",
    },
  },
  (res) => res.resume()
);
req.end(
  "Bumped the kagi-ken AUR package to v0.4.2 and updated the checksums."
);

Something went wrong

const https = require("https");
const req = https.request(
  `https://ntfy.sh/${process.env.NTFY_TOPIC_LLM}`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.NTFY_ACCESS_TOKEN}`,
      Title: "Build failed in pi-mono — disk full",
      Tags: "rotating_light",
      Priority: "4",
    },
  },
  (res) => res.resume()
);
req.end(
  "Ran into a full disk on the build server while compiling pi-mono. /var/log looks like it needs rotation. The build is blocked until there's space."
);

Urgent failure

const https = require("https");
const req = https.request(
  `https://ntfy.sh/${process.env.NTFY_TOPIC_LLM}`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.NTFY_ACCESS_TOKEN}`,
      Title: "Production database unreachable",
      Tags: "sos",
      Priority: "5",
    },
  },
  (res) => res.resume()
);
req.end(
  "The primary Postgres instance stopped responding during a migration. Rolled back what we could, but the app is down."
);