File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,15 @@ const demo2 = new Elysia()
33
33
.use (plugin2)
34
34
.get (' /parent' , () => ' parent' )
35
35
36
+ const mock2 = {
37
+ ' /child' : {
38
+ ' GET' : ' hi'
39
+ },
40
+ ' /parent' : {
41
+ ' GET' : ' hi'
42
+ }
43
+ }
44
+
36
45
const plugin3 = new Elysia ()
37
46
.onBeforeHandle ({ as: ' global' }, () => {
38
47
return ' overwrite'
@@ -44,6 +53,15 @@ const demo3 = new Elysia()
44
53
.get (' /inner' , () => ' inner' )
45
54
)
46
55
.get (' /outer' , () => ' outer' )
56
+
57
+ const mock3 = {
58
+ ' /inner' : {
59
+ ' GET' : ' overwrite'
60
+ },
61
+ ' /outer' : {
62
+ ' GET' : ' outer'
63
+ }
64
+ }
47
65
</script >
48
66
49
67
By default, hook and schema is scope to current instance only not global.
@@ -203,7 +221,7 @@ const app = new Elysia()
203
221
.listen (3000 )
204
222
```
205
223
206
- <Playground :elysia =" demo3 " />
224
+ <Playground :elysia =" demo3 " :mock = " mock3 " />
207
225
208
226
Evaluating the route, should logs as follows:
209
227
| route | response |
@@ -309,4 +327,4 @@ const main = new Elysia()
309
327
.get (' /parent' , () => ' parent' )
310
328
```
311
329
312
- <Playground :elysia =" demo2 " />
330
+ <Playground :elysia =" demo2 " :mock = " mock2 " />
You can’t perform that action at this time.
0 commit comments