Newer
Older
text(":3\nwelcome to the root")
}
hello() {
text("Hello World!")
}
#[route("/example/{id}")]
example(id) {
text("base: " + id)
}
example_test(id) {
text("sub: " + id)
}
#[route("/name/{id}/{name}")]
name(id, name) {
let res = http::get("https://httpbin.org/json");
info: #{
length: res.length,
status: res.status,
error: res.error,
body: res.body,
let body = #{
hello: "world",
url: url,
};
json(http::post("https://httpbin.org/post", body).raw())
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())
}