npm install srvx


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.
``js`
export default {
fetch(req: Request) {
return Response.json({ hello: "world!" });
},
};
Then, run the server using your favorite runtime:
`bashNode.js
$ npx srvx # npm
$ pnpx srvx # pnpm
$ yarn dlx srvx # yarn
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 for more options.
👉 Visit the 📖 Documentation to learn more.
Contribution
- 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_