https://github.com/h3js/srvx
λ Universal Server based on web standards.
https://github.com/h3js/srvx
Last synced: 23 days ago
JSON representation
λ Universal Server based on web standards.
- Host: GitHub
- URL: https://github.com/h3js/srvx
- Owner: h3js
- License: mit
- Created: 2024-09-16T20:20:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-11T00:29:20.000Z (about 1 month ago)
- Last Synced: 2026-02-11T03:51:37.354Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://srvx.h3.dev
- Size: 1.82 MB
- Stars: 729
- Watchers: 9
- Forks: 39
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- stars - srvx
README
# λ srvx
[](https://npmjs.com/package/srvx)
[](https://npm.chart.dev/srvx)
[](https://packagephobia.com/result?p=srvx)
Universal Server based on web standards. Works with [Deno](https://deno.com/), [Bun](https://bun.sh/) and [Node.js](https://nodejs.org/en).
- ✅ Zero dependency
- ✅ Full featured CLI with watcher, error handler, serve static and logger
- ✅ Seamless runtime integration with same API ([handler](https://srvx.h3.dev/guide/handler) and [instance](https://srvx.h3.dev/guide/server)).
- ✅ [Node.js compatibility](https://srvx.h3.dev/guide/node) with a [**close to native performance**](https://github.com/h3js/srvx/tree/main/test/bench-node).
- ✅ Zero overhead [Deno](https://deno.com/) and [Bun](https://bun.sh/) support.
## Quick start
```js
export default {
fetch(req: Request) {
return Response.json({ hello: "world!" });
},
};
```
Then, run the server using your favorite runtime:
```bash
# Node.js
$ npx srvx # npm
$ pnpx srvx # pnpm
$ yarn dlx srvx # yarn
# Deno
$ deno -A npm:srvx
# Bun
$ bunx --bun srvx
```
You can also use `srvx fetch` to directly call your server handler without starting a server:
```bash
$ npx srvx fetch /api/users
```
See [CLI documentation](https://srvx.h3.dev/guide/cli) for more options.
👉 **Visit the 📖 [Documentation](https://srvx.h3.dev/) to learn more.**
## Contribution
- Clone this repository
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- **Prepare stub mode using `pnpm build --stub`**
- Run interactive tests using `pnpm dev`
## License
Published under the [MIT](https://github.com/h3js/srvx/blob/main/LICENSE) license.
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/h3js/srvx/graphs/contributors) 💛
---
_🤖 auto updated with [automd](https://automd.unjs.io)_