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.

26 lines
553 B

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