Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/migrate/from-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,18 @@ const app = new Elysia()

While Express has a `next` function to call the next middleware, Elysia does not has one.

::: tip
Unlike Express which only accepts numeric status codes, Elysia also supports descriptive string names:

```ts
// Both are equivalent in Elysia
return status(401)
return status('Unauthorized')
```

String status names provide TypeScript autocompletion for all valid HTTP statuses, making your code more readable and less error-prone.
:::

## Sounds type safety
Elysia is designed to be sounds type safety.

Expand Down
12 changes: 12 additions & 0 deletions docs/migrate/from-fastify.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,18 @@ const app = new Elysia()

</Compare>

::: tip
Unlike Fastify which only accepts numeric status codes, Elysia also supports descriptive string names:

```ts
// Both are equivalent in Elysia
return status(401)
return status('Unauthorized')
```

String status names provide TypeScript autocompletion for all valid HTTP statuses, making your code more readable and less error-prone.
:::

## Sounds type safety
Elysia is designed to be sounds type safety.

Expand Down
12 changes: 12 additions & 0 deletions docs/migrate/from-hono.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,18 @@ const app = new Elysia()

While Hono has a `next` function to call the next middleware, Elysia does not has one.

::: tip
Unlike Hono which only accepts numeric status codes, Elysia also supports descriptive string names:

```ts
// Both are equivalent in Elysia
return status(401)
return status('Unauthorized')
```

String status names provide TypeScript autocompletion for all valid HTTP statuses, making your code more readable and less error-prone.
:::

## Sounds type safety
Elysia is designed to be sounds type safety.

Expand Down
12 changes: 12 additions & 0 deletions docs/migrate/from-trpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,18 @@ const app = new Elysia()

While tRPC has a `next` function to call the next middleware in the queue, Elysia use specific event interceptor for each point in the request pipeline.

::: tip
Like tRPC's string error codes (e.g., `"UNAUTHORIZED"`), Elysia supports both numeric and string status names:

```ts
// Both are equivalent in Elysia
return status(401)
return status('Unauthorized')
```

This gives you the readability of tRPC's string codes while staying compliant with HTTP standards. String status names also provide TypeScript autocompletion for all valid HTTP statuses.
:::

## Sounds type safety
Elysia is designed to be sounds type safety.

Expand Down