Skip to content

Commit 8e0d1ce

Browse files
committed
docs(tutorial): use string status names in examples
- Convert status(418) to status("I'm a teapot") in validation tutorial - Convert status(418) to status("I'm a teapot") in macro tutorial - Convert status(401) to status("Unauthorized") in macro auth example
1 parent 009e7fd commit 8e0d1ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/tutorial/getting-started/validation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ new Elysia()
134134
.get('/', ({ status, set }) => {
135135
set.headers['x-powered-by'] = 'Elysia'
136136

137-
return status(418, 'Hello Elysia!')
137+
return status("I'm a teapot", 'Hello Elysia!')
138138
})
139139
.get('/docs', ({ redirect }) => redirect('https://elysiajs.com'))
140140
.listen(3000)

docs/tutorial/patterns/macro/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ new Elysia()
6464
}),
6565
// psuedo auth check
6666
beforeHandle({ cookie: { session }, status }) {
67-
if(!session.value) return status(401)
67+
if(!session.value) return status("Unauthorized")
6868
}
6969
})
7070
.post('/user', ({ body }) => body, {
@@ -112,7 +112,7 @@ new Elysia()
112112
.macro('isFibonacci', {
113113
body: t.Number(),
114114
beforeHandle({ body, status }) {
115-
if(!isFibonacci(body)) return status(418)
115+
if(!isFibonacci(body)) return status("I'm a teapot")
116116
}
117117
})
118118
.post('/', ({ body }) => body, {

0 commit comments

Comments
 (0)