add explanation why we need a custom binding
This commit is contained in:
parent
4474769004
commit
d8edb51d6a
|
@ -47,6 +47,10 @@ fn build_routes() -> router::Router {
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern "C" {
|
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;
|
fn fetch(req: &Request) -> Promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue