Easily create CGI (RFC 3875) programmes in Rust based on http
Installation & Usage
Cargo.toml
:
[dependencies]
cgi = "0.1"
In the main
function, call only cgi::handle(...)
, with a function that
takes a cgi::Request
and returns cgi::Response
.
extern crate cgi;
extern crate cgi;
It will parse & extract the CGI environmental variables, and HTTP request body
to create Request
, and convert your Response
into the correct format and
print to stdout. If this programme is not called as CGI (e.g. missing required
environmental variables), it will panic.