diff --git a/ghi/server.py b/ghi/server.py index 347fb93..ce79e96 100644 --- a/ghi/server.py +++ b/ghi/server.py @@ -35,6 +35,7 @@ def GetArgs(): def InvokeFunction(payload): + sys.path.append(os.path.dirname(os.path.realpath(__file__))) from index import handler return handler(payload) @@ -143,7 +144,7 @@ def ShutDown(signum, frame): exit(0) -if __name__ == "__main__": +def main(): try: # Handle logging ourselves logging.getLogger('tornado.access').disabled = True @@ -154,4 +155,8 @@ def ShutDown(signum, frame): logging.info("server listening on %s" % port) tornado.ioloop.IOLoop.current().start() except KeyboardInterrupt: - ShutDown(None, None) \ No newline at end of file + ShutDown(None, None) + + +if __name__ == "__main__": + main() \ No newline at end of file