diff options
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/api.js | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/package.json b/package.json index c7a56b0..1e7ff74 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ }, "dependencies": { "express": "^4.17.0", + "node-fetch": "^2.6.0", "nodemailer": "^6.2.1", "random-number-csprng": "^1.0.2", "ripgrep-bin": "^11.0.1", @@ -1,4 +1,5 @@ const express = require("express"); // from npm registry +const Fetch = require("node-fetch"); // from npm registry const https = require("https"); // built-in const api = express(); @@ -8,7 +9,7 @@ if (process.env.npm_package_config_port === undefined) { } const send_hook = (msg) => { - const req = new Request(process.env.npm_package_config_logger_webhook, { + Fetch(process.env.npm_package_config_logger_webhook, { method: "POST", cache: "no-cache", redirect: "follow", @@ -21,7 +22,6 @@ const send_hook = (msg) => { }), }); - fetch(req); console.log(msg); }; |