Redirect old URL paths to new ones without writing custom route handlers.
Add caching or stale-while-revalidate behavior to specific routes through configuration.
Protect an admin section with basic authentication using a simple rule.
Proxy requests from one path to an external API or another internal route.
| h3js/h3-rules | 0xbebis/hyperpay | alfredxw/nova | |
|---|---|---|---|
| Stars | 14 | 14 | 14 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | moderate | hard | moderate |
| Complexity | 3/5 | 5/5 | 3/5 |
| Audience | developer | developer | writer |
Figures from each repo's GitHub metadata at analysis time.
Caching and proxy features require installing separate optional handlers, still marked work in progress.
h3-rules is a small code library for H3, a lightweight web server framework for JavaScript and TypeScript. It lets a developer describe how different URL paths on their server should behave using a simple configuration object, instead of writing that logic by hand inside each route handler. A single rule can apply a redirect, forward a request to another server through a proxy, add security headers, cache a response, require a username and password, or handle cross-origin requests, and rules can be combined for the same path. Rules are written as patterns matched against the incoming request's URL, similar to file-matching wildcards. When more than one pattern matches a request, all of the matching rules apply together, with more specific patterns overriding broader ones. A rule can also be limited to a single HTTP method, such as only affecting GET requests to a certain path while leaving other methods untouched. The combined result for any given request is available to the rest of the application, so custom code can read what rules apply even if not every rule type has built in behavior. Caching is the one feature that needs an extra piece installed separately, called ocache, so that projects that never use caching do not have that code bundled into their app unnecessarily. Similarly, the proxy feature is an optional add-on rather than part of the core package. The readme is written for developers who are already using or considering H3 in a Node.js style backend project. It assumes familiarity with concepts like HTTP methods, CORS, and basic auth, and is really a reference document for exact behavior and edge cases, such as how query strings are preserved during a redirect or what happens when a rule for a broader path is later overridden by a more specific one. The project is explicitly marked as a work in progress, so behavior may still change before a stable release.
A TypeScript library for the H3 web framework that lets developers define redirect, proxy, caching, and security rules for URL paths through config instead of code.
Mainly TypeScript. The stack also includes TypeScript, H3, Node.js.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.