1 The http module implements a http server. Functions (handlers) can be
2 associated to a specific route using [[handle]]. Routes are matched
3 per [[fnmatch::fnmatch]].
5 The http module relies on the event loop [[ev]].
16 ) (void | io::error) = {
17 http::reply(req, res, 200, "OK")?;
18 http::header(res, "Content-Type", "text/plain")?;
19 fmt::fprintln(res, "Hello, world!")?;
24 export fn main() void = {
27 http::handle("/", &homepage);
28 http::handle("/2", &page2);
30 http::listen_sock(sock, null);