From 89f9571bf46ddcfb1d6298924a4df75da0efc6c8 Mon Sep 17 00:00:00 2001 From: shobhitaa Date: Sat, 11 Sep 2021 21:58:58 +0530 Subject: [PATCH] add heartbeat route --- scripts/jmwalletd.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/jmwalletd.py b/scripts/jmwalletd.py index 2cc010530..289a1be9d 100644 --- a/scripts/jmwalletd.py +++ b/scripts/jmwalletd.py @@ -207,6 +207,16 @@ def displaywallet(self, request, walletname): walletinfo = wallet_display(self.wallet_service, False, jsonified=True) return response(request, walletname=walletname, walletinfo=walletinfo) + #Heartbeat route + + @app.route('/session',methods=['GET']) + def sessionExists(self, request): + #if no wallet loaded then clear frontend session info + #when no wallet status is false + session = not self.cookie==None + return response(request,session=session) + + # handling CORS preflight for any route: @app.route('/', branch=True, methods=['OPTIONS']) def preflight(self, request):