check hapi server status

This commit is contained in:
supositware 2021-03-16 16:18:51 +01:00
parent b4f3592c76
commit 3527ded36f

10
utils/checkHapi.js Normal file
View file

@ -0,0 +1,10 @@
const fetch = require('node-fetch');
const { Hapi } = require('../config.json');
module.exports = async function () {
if (Hapi) {
var res = await fetch(Hapi);
return res.status === 200;
} else
return false;
};