check hapi server status
This commit is contained in:
parent
b4f3592c76
commit
3527ded36f
1 changed files with 10 additions and 0 deletions
10
utils/checkHapi.js
Normal file
10
utils/checkHapi.js
Normal 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;
|
||||
};
|
Loading…
Reference in a new issue