index { text(":3\nwelcome to the root") } hello() { text("Hello World!") } example() { html(http::get("https://example.org").body) } example/json() { let res = http::get("https://httpbin.org/json"); let body = #{ response: res.json(), info: #{ length: res.length, status: res.status, error: res.error, body: res.body, }, }; json(body) } example/post/bin() { let body = #{ hello: "world", url: url, }; json(http::post("https://httpbin.org/post", body).raw()) } test.json() { let res = #{ hello: "world", info: #{ path: path, url: url, ver: ver, query: query, } }; json(res) } test/loadfile() { let file = open_file("test.html"); html(file.read_string()) } // remove to test 404 route * { text("this is a wildcard route\ncurrently on: " + path + "\n\n" + err) } 404 { text("404 page\n\n" + err) }