From 2e41cb1c32167603fb4e2e2f856c004026d63132 Mon Sep 17 00:00:00 2001 From: Leander Hutton Date: Fri, 8 Sep 2017 09:57:03 -0400 Subject: [PATCH] Initial commit --- README | 7 +++++++ yourmomasaservice.py | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 README create mode 100755 yourmomasaservice.py diff --git a/README b/README new file mode 100644 index 0000000..1f15a9b --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +Replies with HTTP status 200 Your Mom + +Usage: + +./yourmomasaservice.py + +curl -i localhost:8080 diff --git a/yourmomasaservice.py b/yourmomasaservice.py new file mode 100755 index 0000000..f85f6e9 --- /dev/null +++ b/yourmomasaservice.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import BaseHTTPServer +import SocketServer + +PORT = 8080 + +class YourMomServer(BaseHTTPServer.BaseHTTPRequestHandler): + def do_GET(self): + self.send_response(200, "Your Mom") + + +httpd = SocketServer.TCPServer(("", PORT), YourMomServer) + +def serve(): + return 1 + +while serve(): + httpd.handle_request() +