mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
11 lines
246 B
JavaScript
11 lines
246 B
JavaScript
const http = require("http");
|
|||
const https = require("https");
|
|||
|
|||
function fetchUrl(targetUrl) {
|
|||
const lib = targetUrl.startsWith("https") ? https : http;
|
|||
const req = lib.request(targetUrl);
|
|||
return req;
|
|||
}
|
|||
|
|||
module.exports = { fetchUrl };
|