Releases: h3js/srvx
v0.11.7
v0.11.6
🚀 Enhancements
- bunny: Add support for native
waitUntil(#186)
❤️ Contributors
- Sandro Circi (@sandros94)
v0.11.5
v0.11.4
v0.11.3
🩹 Fixes
- Avoid
process.exitafter graceful server close (#179) - node: Normalize pipeable bodies in
FastResponsewhen cloning (#177)
❤️ Contributors
- Kai Gritun (@kaigritun)
- Wade Fletcher (@wadefletch)
- Pooya Parsa (@pi0)
v0.11.2
v0.11.1
v0.11.0
⭐ Highlights
srvx fetch|curl
srvx CLI can now fetch ANY server handler (even express!) without listening on a port.
$ npx srvx curl -v /
srvx automatically searches for server entry (server.ts|js) and loads it. If it is a Node.js server, HTTP listener will be automatically mocked and handler will be converted to Web format. Both input and output streams are streamed to and from the console.
You can also fetch any external URL with the new CLI. It will add Accept: text/markdown header by default to allow better content negotiation in CLI, suitable for coding agents. (example: npx srvx curl v3.nitro.build/docs/quick-start)
Tip
Use npx srvx --help or check cli docs for more info.
Improved CLI Behavior
CLI implementation has been rewritten with backwards compatibility.
You can use new srvx serve [--dir] [--entry] syntax to specify server directory and entry.
Programmatic Loader
We have extracted CLI loader functionality to srvx/loader, you can load ANY server entry with same CLI DX and manually .fetch it!
You can also use cliFetch and main from srvx/cli to make a fully customized and branded CLI with same features and DX that srvx has!
AWS Lambda Handler
Srvx now has full support for AWS Lambda Handlers (API Gateway v1 and v2) with optional streaming support.
You can convert a fetchable handler (like H3 or Hono) to AWS Lambda Handler or invoke an AWS Lambda Handler using standard Request and Response (useful for testing).
Check out the docs for more info: https://srvx.h3.dev/guide/aws-lambda
This feature has been backported from Nitro v3 (❤️ thanks to @OskarLebuda).
Changelog
🚀 Enhancements
srvx fetch|curlandcliFetch(#169, #174, 98b35cc, 17e115b, 169e26f, 20796e2)loadServerEntry(#168, #173)aws-lambdaadapter and utils (#104)req.rawBody: Buffersupport in google cloud functions (#166)
🩹 Fixes
- loader: Safer search path for default server entry (8933e6b)
- loader: Mock
server.address()in programmatic mode (c9bb7c6) - cli: Enable
gracefulShutdownonly in production mode (85cce89) - cli: Throw error when no static dir and entry exist (eaa99aa)
- cli: Fixed path to CLI entry (6ad9563)
- cli: Remove hardcoded srvx command from usage (3b224b8)
- Add missing runtime types (5bcec0d)
💅 Refactors
⚠️ Rewrite CLI (#175)
❤️ Contributors
- Pooya Parsa (@pi0)
- Oskar Lebuda (@OskarLebuda)
- Nikita Lvov (@niklv)
v0.10.1
🚀 Enhancements
- Support force close with double Control+C (#163)
🩹 Fixes
- node: Call request abort controller only on close (#161)
- node: Handle multiple close calls (#164)
- Handle non-parsable URLs in printListening (#165)
🏡 Chore
- Swtich to tsgo (#159)
✅ Tests
- Use vitest for bun (#162)
❤️ Contributors
- Pooya Parsa (@pi0)
- Oskar Lebuda (@OskarLebuda)
v0.10.0
Important
This release updates the Node.js adapter to avoid doing any global patches by default.
As a result, in some use-cases like new Request(req), you might see an error like Cannot read private member #state....
You can explicitly opt-in to previous behavior like this:
import { patchGlobalRequest } from "srvx/node";
// Fix compatibility issues with Node.js Request
patchGlobalRequest();Please refer to the docs for more info.
🩹 Fixes
- types: Split HTTP1 and HTTP2 handler types (#154)
- node: Avoid patching global request by default (#155)