Skip to content

Commit 42998af

Browse files
committed
docs: use string status names in remaining numeric-only examples
Convert numeric status codes to string status names in files that don't already have educational comments showing both options: - docs/tutorial/patterns/macro/index.md - docs/tutorial/getting-started/validation/index.md Files with '// or status(...)' comments are left unchanged since those comments help users learn both options are valid. This is a stylistic preference - both forms work identically. String names are more readable and self-documenting.
1 parent 009e7fd commit 42998af

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)