Skip to content

Commit 8da8fdf

Browse files
authored
docs: fix code examples in route-module.md (#14638)
1 parent ecf4432 commit 8da8fdf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
- DigitalNaut
107107
- DimaAmega
108108
- dmitrytarassov
109+
- dogxii
109110
- dokeet
110111
- doytch
111112
- Drishtantr

docs/start/framework/route-module.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ Here's an example middleware to check for logged in users and set the user in
110110
`context` you can then access from loaders:
111111

112112
```tsx filename=routes/_auth.tsx
113-
async function authMiddleware ({
114-
request,
115-
context,
116-
}) => {
113+
async function authMiddleware({ request, context }) {
117114
const session = await getSession(request);
118115
const userId = session.get("userId");
119116

@@ -153,7 +150,7 @@ async function loggingMiddleware(
153150
await next(); // 👈 No Response returned
154151
const duration = performance.now() - start;
155152
console.log(
156-
`${new Date().toISOString()} Response ${response.status} (${duration}ms)`,
153+
`${new Date().toISOString()} (${duration}ms)`,
157154
);
158155
// ✅ No need to return anything
159156
}

0 commit comments

Comments
 (0)