A function with signature
function(req, res, env = character())
See RFC 3875 for details on the CGI
protocol.
The request body (if any) is passed to the external command as standard
intput. mw_cgi() sets CONTENT_LENGTH, CONTENT_TYPE,
GATEWAY_INTERFACE, PATH_INFO, QUERY_STRING, REMOTE_ADDR,
REMOTE_HOST, REMOTE_USER, REQUEST_METHOD, SERVER_NAME,
SERVER_PORT, SERVER_PROTOCOL, SERVER_SOFTEWARE.
It does not currently set the AUTH_TYPE, PATH_TRANSLATED,
REMOTE_IDENT, SCRIPT_NAME environment variables.
The standard output of the external command is used to set the
response status code, the response headers and the response body.
Example output from git's CGI:
Status: 200 OK
Expires: Fri, 01 Jan 1980 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache, max-age=0, must-revalidate
Content-Type: application/x-git-upload-pack-advertisement000eversion 2
0015agent=git/2.42.0
0013ls-refs=unborn
0020fetch=shallow wait-for-done
0012server-option
0017object-format=sha1
0010object-info
0000