feat: container
This commit is contained in:
@@ -29,6 +29,10 @@ impl container::Container for MyContainer {
|
||||
println!("+ fetch: {}, time cost: {}ms", params, e.as_millis());
|
||||
result
|
||||
}
|
||||
|
||||
fn log(&mut self, level: &str, message: &str) {
|
||||
println!("[{}] {}", level, message);
|
||||
}
|
||||
}
|
||||
|
||||
wit_bindgen_wasmtime::import!("../exports.wit");
|
||||
@@ -45,13 +49,17 @@ fn main() -> Result<()> {
|
||||
let eval_t1 = SystemTime::now();
|
||||
let a = exports.eval_javascript(&mut store, r##"
|
||||
function hi(name) { return "hi: " + name; }
|
||||
console.log('hello', 1, true);
|
||||
let a = [];
|
||||
// a.push(console);
|
||||
console.log('query: ' + 'print_request.action');
|
||||
a.push(fetch('https://hatter.ink/util/print_request.action', {
|
||||
headers: {
|
||||
'Test-Header': 'this is a test header'
|
||||
}
|
||||
}));
|
||||
// a.push(fetch('https://hatter.ink/ip.action'));
|
||||
console.log('query: ' + 'ip.jsonp');
|
||||
a.push(fetch('https://hatter.ink/ip/ip.jsonp'));
|
||||
// a.push(fetch('https://hatter.ink/ip2.action'));
|
||||
a.push({
|
||||
|
||||
Reference in New Issue
Block a user