mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-01-07 14:05:46 +00:00
17 lines
573 B
JavaScript
17 lines
573 B
JavaScript
const config = require("./configuration.js");
|
|
|
|
module.exports = async function getWingsStatus(node, nodeToken) {
|
|
return fetch(`${node.attributes.scheme}://${node.attributes.fqdn}:${node.attributes.daemon_listen}/api/servers`, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
"Authorization": `Bearer ${nodeToken}`
|
|
},
|
|
})
|
|
.then((res) => res.json())
|
|
.then(() => true)
|
|
.catch((error) => {
|
|
if (config.log_error) console.error(error);
|
|
return false
|
|
})
|
|
} |