From e120c43663cfb903415d7da5e9619451e8a108fc Mon Sep 17 00:00:00 2001 From: Dave Page Date: Fri, 4 Oct 2013 17:31:08 +0100 Subject: [PATCH] Add a "ping" handler. --- web/pgAdmin4.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py index 770514c5d..dd18c2b07 100755 --- a/web/pgAdmin4.py +++ b/web/pgAdmin4.py @@ -12,9 +12,11 @@ import cherrypy from time import time,ctime -# This is the main application class that we'll run under CherryPy. For now, -# we'll just output some basic HTML so we can see that everything is running. +# This is the main application class that we'll run under CherryPy. class pgAdmin4(object): + + # The main index page + @cherrypy.expose def index(self): output = """ Today is %s @@ -25,7 +27,11 @@ Today is %s return output - index.exposed = True + + # A special URL used to "ping" the server + @cherrypy.expose + def ping(self): + return "PING" # Start the web server. The port number should have already been set by the