allow website to respond when ccash instance down

This commit is contained in:
Expand 2023-11-30 14:27:50 +11:00
parent 07b9afd505
commit 2a57bab0a2

View file

@ -80,11 +80,16 @@ fastify.get("/", async function (req, res) {
let errors = req.session.errors;
req.session.errors = "";
console.log(`${api}/api/properties`);
let checkalive = await fetch(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
});
try{
let checkalive = await fetch(`${api}/api/properties`, {
headers: {
Accept: "application/json",
},
});
} catch (e){
console.log(e)
}
let alive = false
if (checkalive.ok) {
alive = true;