CGI backend for datadb
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
553 B

#!/usr/bin/env python3
import os
from urllib.parse import parse_qs
def start_response(content_type="text/html", status_code=("200", "OK",)):
print('Status: %s %s' % (status_code))
print("Content-Type: %s" % content_type)
print()
if __name__ == "__main__":
try:
data = parse_qs(os.environ["QUERY_STRING"])
assert "yo" in data
start_response()
print("you passed: ?yo=%s" % data["yo"][0])
except Exception as e:
start_response(status_code=('500', "you fucked up"))
print(str(e))