You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/patterns/mount.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,13 @@ head:
15
15
---
16
16
17
17
# Mount
18
-
WinterCG is a standard for web-interoperable runtimes supports by Cloudflare, Deno, Vercel Edge Runtime, Netlify Function and various more, allowing web server to runs interoperable across runtime, which use Web Standard definitions like `Fetch`, `Request`, and `Response`.
18
+
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`.
19
19
20
-
Elysia is WinterCG compliance as we are optimized to Bun but also openly support other runtime if possible.
20
+
Elysia is WinterCG compliant. We are optimized to run on Bun but also openly support other runtimes if possible.
21
21
22
-
In theory, this allows any framework or code that is WinterCG compliance to be run together, allowing framework like Elysia, Hono, Remix, Itty Router to runs together in a simple function.
22
+
In theory, this allows any framework or code that is WinterCG compliant to be run together, allowing frameworks like Elysia, Hono, Remix, Itty Router to run together in a simple function.
23
23
24
-
By this, we implemented the same logic for Elysia by introducing `.mount` method to runs any framework or code that is WinterCG compliant.
24
+
Adhering to this, we implemented the same logic for Elysia by introducing `.mount` method to run with any framework or code that is WinterCG compliant.
25
25
26
26
## Mount
27
27
To use `.mount`, [simply pass a `fetch` function](https://twitter.com/saltyAom/status/1684786233594290176):
@@ -38,7 +38,7 @@ A **fetch** function is a function that accepts a Web Standard Request and retur
38
38
typefetch= (request:RequestLike) =>Response
39
39
```
40
40
41
-
By default, this declaration are used by:
41
+
By default, this declaration is used by:
42
42
- Bun
43
43
- Deno
44
44
- Vercel Edge Runtime
@@ -47,9 +47,9 @@ By default, this declaration are used by:
47
47
- Remix Function Handler
48
48
- etc.
49
49
50
-
Which means you can run all of the above code to interlop with Elysia all in a single server, or re-used and existing functions all in one deployment, no need to set up a Reverse Proxy for handling multiple servers.
50
+
This allows you to execute all the aforementioned code in a single server environment, making it possible to interact seamlessly with Elysia. You can also reuse existing functions within a single deployment, eliminating the need for a reverse proxy to manage multiple servers.
51
51
52
-
If the framework also support a **.mount** function, you can deeply nested a framework that support it infinitely.
52
+
If the framework also supports a **.mount** function, you can deeply nest a framework that supports it.
53
53
```ts
54
54
const elysia =newElysia()
55
55
.get('/Hello from Elysia inside Hono inside Elysia')
@@ -65,7 +65,7 @@ const main = new Elysia()
65
65
```
66
66
67
67
## Reusing Elysia
68
-
You can even re-use multiple existing Elysia project in your server.
68
+
Moreover, you can re-use multiple existing Elysia projects on your server.
69
69
70
70
```ts
71
71
importAfrom'project-a/elysia'
@@ -80,4 +80,4 @@ new Elysia()
80
80
81
81
If an instance passed to `mount` is an Elysia instance, it will be resolved with `use` automatically, providing type-safety and support for Eden by default.
82
82
83
-
This made the possiblility of interlopable framework and runtime, into a reality.
83
+
This makes the possibility of an interoperable framework and runtime a reality.
0 commit comments