Skip to content

Commit bfc2f5e

Browse files
docs: use event.url.pathname in lifecycle hook examples (#4442)
1 parent 7af4fee commit bfc2f5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/1.docs/50.lifecycle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { definePlugin } from "nitro";
2121

2222
export default definePlugin((nitroApp) => {
2323
nitroApp.hooks.hook("request", (event) => {
24-
console.log(`Incoming request on ${event.path}`);
24+
console.log(`Incoming request on ${event.url.pathname}`);
2525
});
2626
});
2727
```
@@ -123,7 +123,7 @@ import { definePlugin } from "nitro";
123123

124124
export default definePlugin((nitroApp) => {
125125
nitroApp.hooks.hook("response", (res, event) => {
126-
console.log(`Response ${res.status} for ${event.path}`);
126+
console.log(`Response ${res.status} for ${event.url.pathname}`);
127127
});
128128
});
129129
```

0 commit comments

Comments
 (0)