Universal Server based on web standards. Works with Deno, Bun and Node.js.
- ✅ Zero dependency
- ✅ Full featured CLI with watcher, error handler, serve static and logger
- ✅ Seamless runtime integration with same API (handler and instance).
- ✅ Node.js compatibility with a close to native performance.
- ✅ Zero overhead Deno and Bun support.
export default { fetch(req: Request) { return Response.json({ hello: "world!" }); }, };Then, run the server using your favorite runtime:
# Node.js $ npx srvx # npm $ pnpx srvx # pnpm $ yarn dlx srvx # yarn # Deno $ deno -A npm:srvx # Bun $ bunx --bun srvx👉 Visit the 📖 Documentation to learn more.
| Example | Source | Try |
|---|---|---|
elysia | examples/elysia | npx giget gh:h3js/srvx/examples/elysia srvx-elysia |
express | examples/express | npx giget gh:h3js/srvx/examples/express srvx-express |
fastify | examples/fastify | npx giget gh:h3js/srvx/examples/fastify srvx-fastify |
h3 | examples/h3 | npx giget gh:h3js/srvx/examples/h3 srvx-h3 |
hello-world | examples/hello-world | npx giget gh:h3js/srvx/examples/hello-world srvx-hello-world |
hono | examples/hono | npx giget gh:h3js/srvx/examples/hono srvx-hono |
jsx | examples/jsx | npx giget gh:h3js/srvx/examples/jsx srvx-jsx |
node-handler | examples/node-handler | npx giget gh:h3js/srvx/examples/node-handler srvx-node-handler |
service-worker | examples/service-worker | npx giget gh:h3js/srvx/examples/service-worker srvx-service-worker |
tracing | examples/tracing | npx giget gh:h3js/srvx/examples/tracing srvx-tracing |
websocket | examples/websocket | npx giget gh:h3js/srvx/examples/websocket srvx-websocket |
- Clone this repository
- Install the latest LTS version of Node.js
- Enable Corepack using
corepack enable - Install dependencies using
pnpm install - Prepare stub mode using
pnpm build --stub - Run interactive tests using
pnpm dev
Published under the MIT license. Made by @pi0 and community 💛
🤖 auto updated with automd