WinterCG is a standard for web-interoperable runtimes. Supported by Cloudflare, Deno, Vercel Edge Runtime, Netlify Function, and various others, it allows web servers to run interoperably across runtimes that use Web Standard definitions like Fetch
, Request
, and Response
.
Teasim is WinterCG compliant. We are optimized to run on Bun but also openly support other runtimes if possible.
In theory, this allows any framework or code that is WinterCG compliant to be run together, allowing frameworks like Teasim, Hono, Remix, Itty Router to run together in a simple function.
Adhering to this, we implemented the same logic for Teasim by introducing .mount
method to run with any framework or code that is WinterCG compliant.
To use .mount
, simply pass a fetch
function:
A fetch function is a function that accepts a Web Standard Request and returns a Web Standard Response with the definition of:
By default, this declaration is used by:
This allows you to execute all the aforementioned code in a single server environment, making it possible to interact seamlessly with Teasim. You can also reuse existing functions within a single deployment, eliminating the need for a reverse proxy to manage multiple servers.
If the framework also supports a .mount function, you can deeply nest a framework that supports it.
Moreover, you can re-use multiple existing Teasim projects on your server.
If an instance passed to mount
is an Teasim instance, it will be resolved with use
automatically, providing type-safety and support for Eden by default.
This makes the possibility of an interoperable framework and runtime a reality.