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
Elysia read the body schema and found that, the type is entirely an object, so it's likely that the body will be JSON, Elysia then pick the JSON body parser function ahead of time and try to parse the body.
34
+
Elysia read the body schema and found that, the type is entirely an object, so it's likely that the body will be JSON. Elysia then picks the JSON body parser function ahead of time and tries to parse the body.
35
35
36
-
Here's a criteria that Elysia use to pick up type of body parser
36
+
Here's a criteria that Elysia uses to pick up type of body parser
37
37
38
38
-`application/json`: body typed as `t.Object`
39
39
-`multipart/form-data`: body typed as `t.Object`, and is 1 level deep with `t.File`
@@ -43,7 +43,7 @@ Here's a criteria that Elysia use to pick up type of body parser
43
43
This allows Elysia to optimize body parser ahead of time, and reduce overhead in compile time.
44
44
45
45
## Explicit Content Type
46
-
However, is some scenario that Elysia fail to pick the correct body parser function, you can explicitly tell Elysia to use a certain function by specifying `type`
46
+
However, in some scenario if Elysia fails to pick the correct body parser function, you can explicitly tell Elysia to use a certain function by specifying `type`
Copy file name to clipboardExpand all lines: docs/concept/guard.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Suppose you have many shared local hooks.
21
21
Instead of duplicating an existing hook, you can define a shared hook scope using `guard`.
22
22
23
23
---
24
-
**Guard** lets you inject multiple life-cycle events into multiple routes at once. Guard is useful when you have listen to same life-cycle events in the multiple routes, for example: logging, schema validation, or error handling.
24
+
**Guard** lets you inject multiple life-cycle events into multiple routes at once. Guard is useful when you have to listen to the same life-cycle event in multiple routes, for example: logging, schema validation, or error handling.
25
25
26
26
To encapsulate all hooks into the scope, instead of writing:
Copy file name to clipboardExpand all lines: docs/concept/plugin.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ const app = new Elysia()
89
89
Config type will be inferred into `use`, generating auto completion and type strict as intend.
90
90
91
91
## Plugin deduplication
92
-
By default, Elysia will registered any plugin and handle type definitions which when using multiple times will results in a multiple duplication of setting value or routes.
92
+
By default, Elysia will register any plugin and handle type definitions which when using multiple times will results in a multiple duplication of setting value or routes.
93
93
94
94
This can be fixed by providing name and optional seeds to help Elysia identify instance duplication:
0 commit comments