Skip to content

Commit d86a52f

Browse files
committed
docs: show string status names in key-concept examples
Add inline comments showing string alternatives: - status(401) // or status("Unauthorized")
1 parent 5964cab commit d86a52f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/key-concept.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ import { Elysia } from 'elysia'
1919
import Playground from './components/nearl/playground.vue'
2020

2121
const profile1 = new Elysia()
22-
.onBeforeHandle(({ status }) => status(401))
23-
.get('/profile', ({ status }) => status(401))
22+
.onBeforeHandle(({ status }) => status(401)) // or status("Unauthorized")
23+
.get('/profile', ({ status }) => status(401)) // or status("Unauthorized")
2424

2525
const demo1 = new Elysia()
2626
.use(profile1)
2727
// This will NOT have sign in check
2828
.patch('/rename', () => 'Updated!')
2929

3030
const profile2 = new Elysia()
31-
.onBeforeHandle({ as: 'global' }, ({ status }) => status(401))
32-
.get('/profile', ({ status }) => status(401))
31+
.onBeforeHandle({ as: 'global' }, ({ status }) => status(401)) // or status("Unauthorized")
32+
.get('/profile', ({ status }) => status(401)) // or status("Unauthorized")
3333

3434
const demo2 = new Elysia()
3535
.use(profile2)
3636
// This will NOT have sign in check
37-
.patch('/rename', ({ status }) => status(401))
37+
.patch('/rename', ({ status }) => status(401)) // or status("Unauthorized")
3838
</script>
3939

4040
# Key Concept <Badge type="danger" text="MUST READ" />

0 commit comments

Comments
 (0)