This example shows how to run a WinterCG-compatible worker—powered by WinterJS—on Wasmer Edge.
Full tutorial: https://docs.wasmer.io/edge/quickstart/js-wintercg
https://wasmer-js-worker-starter.wasmer.app/
src/index.js exports a single fetch event handler:
handler(request)serialises the worker’s environment (process.env) into JSON.addEventListener("fetch", ...)registers the handler so every request returns the JSON payload.
Because WinterJS implements the WinterCG APIs, the same worker can run on Wasmer Edge or other compatible hosts.
wasmer run .The Wasmer CLI bundles and serves the worker on http://127.0.0.1:8080/. Modify src/index.js, rerun the command, and refresh to test changes.
- Ensure your project exports a fetch handler from
src/index.js(or another entrypoint defined inwasmer.toml). - Deploy with
wasmer deployor via the Wasmer dashboard. - Hit
https://<your-subdomain>.wasmer.app/to inspect the response.