File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -43,22 +43,16 @@ Context's properties consists of
43
43
- ` headers ` : response headers
44
44
- ` redirect ` : redirect to new path
45
45
46
- And a few helper methods for convenient usage:
47
- - ` status ` : Function to set HTTP response status code
48
- - ` redirect ` : Function to redirect to different path
49
- - ` setHeader ` : Syntax sugar for setting specific header value
50
-
51
- For both context, you can easily access in ` Handler ` function:
46
+ You can access ` Context ` in ` Handler ` function:
52
47
` ` ` typescript
53
48
app .post (' /' , ({ body , set }) => {
54
49
const signed = signIn (body )
55
50
56
51
if (signed )
57
52
return ' Welcome back'
58
- else {
59
- set .status = 403
60
- return ' Invalid username or password'
61
- }
53
+
54
+ set .status = 403
55
+ return ' Invalid username or password'
62
56
})
63
57
` ` `
64
58
You can’t perform that action at this time.
0 commit comments