add explanation why we need a custom binding

This commit is contained in:
Peter Cai 2020-04-09 19:18:48 +08:00
parent 4474769004
commit d8edb51d6a
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
1 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,10 @@ fn build_routes() -> router::Router {
#[wasm_bindgen]
extern "C" {
// This binds to the fetch function in global scope
// In cloudflare workers, there's no Window object
// and unfortunately the bionding in web_sys depends
// on Window being present.
fn fetch(req: &Request) -> Promise;
}