-
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add express to preferred manifest
#412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
265281f
feat: add `express` to replacements
gameroman 94721b6
wip
gameroman 8f0bc10
wip
gameroman c8efbec
wip
gameroman f106bf2
fix
gameroman b63cc8a
update documentation
gameroman 25961de
fix
gameroman b7ccf06
Merge branch 'main' into express
gameroman 7eac53e
fix
gameroman 1f9fe31
update docs
gameroman c972ea0
update elysia note
gameroman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| description: Modern alternatives to the express package | ||
| --- | ||
|
|
||
| # Replacements for `express` | ||
|
|
||
| Express has been the industry standard for years, but the ecosystem has shifted toward ESM-first, type-safe, and runtime-agnostic frameworks that offer significantly better performance and developer experience. | ||
|
|
||
| ## `h3` | ||
|
|
||
| [`h3`](https://github.com/h3js/h3) is a minimal H(TTP) framework built for high performance and portability. | ||
|
|
||
| Example: | ||
|
|
||
| <!-- prettier-ignore --> | ||
| ```ts | ||
| import express from 'express' // [!code --] | ||
| import { H3, defineHandler, toNodeHandler } from 'h3' // [!code ++] | ||
| import { createServer } from 'node:http' // [!code ++] | ||
|
|
||
| const app = express() // [!code --] | ||
| const app = new H3() // [!code ++] | ||
|
|
||
| app.get('/', (req, res) => res.send('Hello world')) // [!code --] | ||
| app.get('/', defineHandler(() => 'Hello world')) // [!code ++] | ||
|
|
||
| app.listen(3000) // [!code --] | ||
| createServer(toNodeHandler(app)).listen(3000) // [!code ++] | ||
| ``` | ||
|
|
||
| ## `tinyhttp` | ||
|
|
||
| [`tinyhttp`](https://github.com/tinyhttp/tinyhttp) is designed to be a drop-in replacement remaining compatible with many Express middlewares. | ||
|
|
||
| Example: | ||
|
|
||
| ```ts | ||
| import express from 'express' // [!code --] | ||
| import { App } from '@tinyhttp/app' // [!code ++] | ||
|
|
||
| const app = express() // [!code --] | ||
| const app = new App() // [!code ++] | ||
|
|
||
| app.get('/', (req, res) => res.send('Hello world')) | ||
|
|
||
| app.listen(3000) | ||
| ``` | ||
|
|
||
| ## `hono` | ||
|
|
||
| [`hono`](https://github.com/honojs/hono) is a small, simple, and fast web framework for the Edges. | ||
|
|
||
| Example: | ||
|
|
||
| ```ts | ||
| import express from 'express' // [!code --] | ||
| import { Hono } from 'hono' // [!code ++] | ||
|
|
||
| const app = express() // [!code --] | ||
| const app = new Hono() // [!code ++] | ||
|
|
||
| app.get('/', (req, res) => res.send('Hello world')) // [!code --] | ||
| app.get('/', (context) => context.text('Hello world')) // [!code ++] | ||
|
|
||
| export default app // [!code ++] | ||
| ``` | ||
|
|
||
| ## `elysia` | ||
|
|
||
| If you are using Bun, [`elysia`](https://github.com/elysiajs/elysia) is often the best choice as it is specifically optimized for the Bun runtime. | ||
|
|
||
| Example: | ||
|
|
||
| ```ts | ||
| import express from 'express' // [!code --] | ||
| import { Elysia } from 'elysia' // [!code ++] | ||
|
|
||
| const app = express() // [!code --] | ||
| const app = new Elysia() // [!code ++] | ||
|
|
||
| app.get('/', (req, res) => res.send('Hello world')) // [!code --] | ||
| app.get('/', () => 'Hello world') // [!code ++] | ||
|
|
||
| app.listen(3000) | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.