diff --git a/search.py b/search.py index 58eb52c..f53cb75 100755 --- a/search.py +++ b/search.py @@ -3,7 +3,6 @@ # You can test it with: # curl --request POST --data string=foobar\&what=language http://localhost:4000 -import wsgiref.simple_server as server import urllib.parse # PostgreSQL interface @@ -12,7 +11,6 @@ import psycopg2 # HTML templates http://www.yattag.org/ from yattag import Doc -PORT = 4000 REDIRECTION_URL = "https://www.langtag.net/registries/registry-html" # For # local testing: Firefox apparently does not accept a redirect to a # file. @@ -119,9 +117,6 @@ def application(environ, start_response): text("\"%s\" not found\r\n" % term) return pack(start_response, status, title, doc, headers) -if __name__ == "__main__": - conn = psycopg2.connect("dbname=lsr") - cursor = conn.cursor() - httpd = server.make_server("", PORT, application) - print("Listening on port %s" % PORT) - httpd.serve_forever() +# Initialize +conn = psycopg2.connect("dbname=lsr") +cursor = conn.cursor()