-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare Workers Tutorial Boilerplate WASM WASI #138
Comments
@dtruffaut Hi Denis, I'll also link to the Denoflare demo in the README of this repo also, so that others can see Photon and Cloudflare Workers in action 🎉 Thanks again! |
That would be awesome! Sadly I can't find an example using Photon on Cloudflare without Deno. And a quick read-through of the the Demo code above shows several Deno-specific changes + several includes that seems to hold code for other Demos in this repository. So testing what is (not) needed without Deno or other demo modules is not a quick job (for me, at least :-). So a short example of how to run on CF without Deno would be greatly appreciated. No need to be as extensive, just some code example with one working image manipulation would already be a huge help. Thanks! |
look here https://github.com/ccbikai/cloudflare-worker-image |
Cloudflare Workers is a popular serverless platform.
A tutorial + boilerplate explaining how to setup Photon would be awesome.
Cloudflare Workers supports Photon
Demo
https://image-demo.denoflare.dev/
https://denoflare.dev/examples/transform-images-wasm
Code
https://github.com/skymethod/denoflare/blob/v0.5.8/examples/image-demo-worker/img.ts
https://github.com/skymethod/denoflare/blob/9e01b76e6569653c7092a9ab3280e190e146300b/common/import_wasm.ts
Cloudflare Workers supports WASI
Native: https://blog.cloudflare.com/running-zig-with-wasi-on-cloudflare-workers/
Javascript: https://blog.cloudflare.com/announcing-wasi-on-workers/ (Preferred)
cargo build --target wasm32-wasi --release
Cloudflare Workers supports Fetch
No need for
node-fetch, you can fetch directly in Cloudflare Workersconst response = await fetch(url, init);
init
is basically the request options plus some Cloudflare extra parameters if needed.https://developers.cloudflare.com/workers//runtime-apis/request#requestinit
--
Reducing the deployment friction with a tutorial would facilitate the web developers adoption.
This is an opportunity to make Photon super popular.
Thanks :)
The text was updated successfully, but these errors were encountered: