going-flying.com gemini git repository
4e25044413ab751f06ae691c1609737d25e66660 - Matthew Ernisse - 1595810833
test cgi script
diff --git a/cgi-bin/example.py b/cgi-bin/example.py new file mode 100755 index 0000000..c73a903 --- /dev/null +++ b/cgi-bin/example.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import os +import sys + +if __name__ == '__main__': + print('20 text/gemini\r\n') + print(''' + +This is a CGI test. Below enumerates the environment passed by the server to the script. + +``` +''') + for k, v in os.environ.items(): + print(f'{k}={v}') + + print() + print(''' + +And below here are any parameters passed to the script itself. + +``` +''') + + print(sys.argv[1:]) + print() + print('```')