Skip to content

Commit 5897cdf

Browse files
authored
Merge branch 'main' into patch-1
2 parents c0539a7 + ff11d6a commit 5897cdf

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/essential/life-cycle.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ head:
1616

1717
# Life Cycle
1818

19-
Also knows as middleware with name in Express or Hook in Fastify.
19+
Also known as middleware with name in Express or Hook in Fastify.
2020

2121
Imagine we want to return a text of HTML.
2222

2323
We need to set **"Content-Type"** headers as **"text/html"** to for browser to render HTML.
2424

25-
Explicitly specify that response is HTML could be repetitive if there are a lot of handlers, says ~200 endpoints.
25+
Explicitly specifying that response is HTML could be repetitive if there are a lot of handlers, says ~200 endpoints.
2626

27-
We can see a duplicated code for just to specify that response is HTML.
27+
We can see a duplicated code for just specifying that response is HTML.
2828

2929
But what if after we sent a response, we could detect if a response is an HTML string then append headers automatically?
3030

@@ -46,7 +46,7 @@ Most of the events you are going to use are highlighted in the blue area but to
4646
Elysia does the following for every request:
4747

4848
1. **Request**
49-
- Notify new event is received, providing only the most minimal context to reduce overhead
49+
- Notify when a new event is received, providing only the most minimal context to reduce overhead
5050
- Best for:
5151
- Caching
5252
- Analytics
@@ -87,15 +87,15 @@ These events are designed to help you decouple code into smaller reusable pieces
8787

8888
## Hook
8989

90-
We refer to each function that intercepts the life cycle event as **"hook"**, as the function hook into the lifecycle event.
90+
We refer to each function that intercepts the life cycle event as **"hook"**, as the function hooks into the lifecycle event.
9191

9292
Hooks can be categorized into 2 types:
9393

9494
1. Local Hook: Execute on a specific route
9595
2. Interceptor Hook: Execute on every route
9696

9797
::: tip
98-
The hook will accept the same Context as a handler, you can imagine you adding a route handler but at a specific point.
98+
The hook will accept the same Context as a handler, you can imagine adding a route handler but at a specific point.
9999
:::
100100

101101
## Local Hook
@@ -187,4 +187,4 @@ Console should log as the following:
187187
1
188188
2
189189
3
190-
```
190+
```

docs/patterns/cookie-signature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ new Elysia()
3939
name: t.String()
4040
})
4141
}, {
42-
secret: 'Fischl von Luftschloss Narfidort',
42+
secrets: 'Fischl von Luftschloss Narfidort',
4343
sign: ['profile']
4444
})
4545
})

docs/plugins/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ This is to ensure developers end up with a performant web server they intend to
8080
- [Elysia Flash Messages](https://github.com/gtramontina/elysia-flash-messages) - enable flash messages
8181
- [Elysia AuthKit](https://github.com/gtramontina/elysia-authkit) - unnoficial [WorkOS' AuthKit](https://www.authkit.com/) authentication
8282
- [Elysia Error Handler](https://github.com/gtramontina/elysia-error-handler) - simpler error handling
83+
- [Elysia Drizzle Schema](https://github.com/Edsol/elysia-drizzle-schema) - Helps to use Drizzle ORM schema inside elysia swagger model.
8384
- [Unify-Elysia](https://github.com/qlaffont/unify-elysia) - Unify error code for Elysia
8485
- [Unify-Elysia-GQL](https://github.com/qlaffont/unify-elysia-gql) - Unify error code for Elysia GraphQL Server (Yoga & Apollo)
8586
- [Elysia Auth Drizzle](https://github.com/qlaffont/elysia-auth-drizzle) - Library who handle authentification with JWT (Header/Cookie/QueryParam).

0 commit comments

Comments
 (0)