routup 5.1.1 → 6.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  <div align="center">
2
2
 
3
- [![Routup banner](./.github/assets/banner.png)](https://routup.net)
3
+ [![Routup banner](.github/assets/banner.png)](https://routup.dev)
4
4
 
5
5
  </div>
6
6
 
7
7
  # Routup 🧙‍
8
8
 
9
9
  [![npm version](https://badge.fury.io/js/routup.svg)](https://badge.fury.io/js/routup)
10
- [![main](https://github.com/Tada5hi/routup/actions/workflows/main.yml/badge.svg)](https://github.com/Tada5hi/routup/actions/workflows/main.yml)
11
- [![codecov](https://codecov.io/gh/tada5hi/routup/branch/master/graph/badge.svg?token=CLIA667K6V)](https://codecov.io/gh/tada5hi/routup)
12
- [![Known Vulnerabilities](https://snyk.io/test/github/Tada5hi/routup/badge.svg)](https://snyk.io/test/github/Tada5hi/routup)
10
+ [![main](https://github.com/routup/routup/actions/workflows/main.yml/badge.svg)](https://github.com/routup/routup/actions/workflows/main.yml)
11
+ [![codecov](https://codecov.io/gh/routup/routup/branch/master/graph/badge.svg?token=CLIA667K6V)](https://codecov.io/gh/routup/routup)
12
+ [![Known Vulnerabilities](https://snyk.io/test/github/routup/routup/badge.svg)](https://snyk.io/test/github/routup/routup)
13
13
  [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
14
14
 
15
- **Routup** is a minimalistic, runtime-agnostic HTTP routing framework for Node.js, Bun, Deno, and Cloudflare Workers.
16
- Handlers return values directly — routup converts them to Web `Response` objects automatically.
15
+ **Routup** is a minimalistic, runtime-agnostic HTTP routing framework for Node.js, Bun, Deno, Cloudflare Workers, and Service Workers.
16
+ Handlers return values directly — routup converts them to Web `Response` objects automatically, with built-in support for ETags, content negotiation, per-handler timeouts, and cooperative cancellation via `AbortSignal`.
17
17
 
18
18
  **Table of Contents**
19
19
 
@@ -21,7 +21,9 @@ Handlers return values directly — routup converts them to Web `Response` objec
21
21
  - [Features](#features)
22
22
  - [Documentation](#documentation)
23
23
  - [Usage](#usage)
24
+ - [Templates](#templates)
24
25
  - [Plugins](#plugins)
26
+ - [Comparison](#comparison)
25
27
  - [Contributing](#contributing)
26
28
  - [License](#license)
27
29
 
@@ -33,13 +35,21 @@ npm install routup --save
33
35
 
34
36
  ## Features
35
37
 
36
- - 🚀 **Runtime agnostic** — Node.js, Bun, Deno, Cloudflare Workers
37
- - 📝 **Return-based handlers** — return strings, objects, streams, or `Response` directly
38
+ - 🚀 **Runtime agnostic** — Node.js, Bun, Deno, Cloudflare Workers, Service Workers
39
+ - 🌐 **Web-standard APIs** — built on `Request` / `Response` for portability
40
+ - 📝 **Return-based handlers** — return strings, objects, streams, `Blob`s, or `Response` directly
38
41
  - ✨ **Async middleware** — onion model with `event.next()`
39
42
  - 📌 **Lifecycle hooks** — `request`, `response`, `error` for cross-cutting concerns
43
+ - 🧭 **Pluggable router & cache** — `LinearRouter` (default), `TrieRouter`, or `SmartRouter` (auto-selects); opt-in LRU lookup cache
44
+ - ⏱️ **Per-handler timeouts** — bounded execution with `AbortSignal` cooperative cancellation
45
+ - 🏷️ **Automatic ETag & 304** — strong/weak ETags out of the box, configurable per app or disabled entirely
46
+ - 🤝 **Content negotiation** — accept, accept-language, accept-encoding, accept-charset helpers
47
+ - 📡 **Streaming & SSE** — `ReadableStream` responses and `createEventStream()` for server-sent events
48
+ - 📂 **Static file serving** — `sendFile()` with ETag, range, and MIME detection
40
49
  - 🔌 **Plugin system** — extend with reusable, installable plugins
50
+ - 🌉 **Express middleware bridge** — wrap legacy `(req, res, next)` handlers via `fromNodeHandler()`
41
51
  - 🧰 **Tree-shakeable helpers** — import only what you use
42
- - 📁 **Nestable routers** — modular route composition
52
+ - 📁 **Nestable apps** — modular route composition with mount paths
43
53
  - 👕 **TypeScript first** — fully typed API with generics
44
54
  - 🤏 **Minimal footprint** — small core, no bloat
45
55
 
@@ -56,37 +66,37 @@ Handlers receive an event and return a value. Routup converts the return value t
56
66
  **Shorthand**
57
67
 
58
68
  ```typescript
59
- import { Router, defineCoreHandler, defineErrorHandler, serve } from 'routup';
69
+ import { App, defineCoreHandler, defineErrorHandler, serve } from 'routup';
60
70
 
61
- const router = new Router();
71
+ const app = new App();
62
72
 
63
- router.get('/', defineCoreHandler(() => 'Hello, World!'));
64
- router.get('/greet/:name', defineCoreHandler((event) => `Hello, ${event.params.name}!`));
65
- router.use(defineErrorHandler((error) => ({ error: error.message })));
73
+ app.get('/', defineCoreHandler(() => 'Hello, World!'));
74
+ app.get('/greet/:name', defineCoreHandler((event) => `Hello, ${event.params.name}!`));
75
+ app.use(defineErrorHandler((error) => ({ error: error.message })));
66
76
 
67
- serve(router, { port: 3000 });
77
+ serve(app, { port: 3000 });
68
78
  ```
69
79
 
70
80
  **Verbose**
71
81
 
72
82
  ```typescript
73
- import { Router, defineCoreHandler, serve } from 'routup';
83
+ import { App, defineCoreHandler, serve } from 'routup';
74
84
 
75
- const router = new Router();
85
+ const app = new App();
76
86
 
77
- router.use(defineCoreHandler({
87
+ app.use(defineCoreHandler({
78
88
  path: '/',
79
89
  method: 'GET',
80
90
  fn: () => 'Hello, World!',
81
91
  }));
82
92
 
83
- router.use(defineCoreHandler({
93
+ app.use(defineCoreHandler({
84
94
  path: '/greet/:name',
85
95
  method: 'GET',
86
96
  fn: (event) => `Hello, ${event.params.name}!`,
87
97
  }));
88
98
 
89
- serve(router, { port: 3000 });
99
+ serve(app, { port: 3000 });
90
100
  ```
91
101
 
92
102
  ### Return Values
@@ -105,26 +115,68 @@ serve(router, { port: 3000 });
105
115
  Middleware calls `event.next()` to continue the pipeline:
106
116
 
107
117
  ```typescript
108
- router.use(defineCoreHandler(async (event) => {
118
+ app.use(defineCoreHandler(async (event) => {
109
119
  console.log(`${event.method} ${event.path}`);
110
120
  return event.next();
111
121
  }));
112
122
  ```
113
123
 
124
+ ### Pluggable router and cache
125
+
126
+ The route table is pluggable via the `router` option. The default `LinearRouter` is best for small apps; swap to `TrieRouter` for radix-trie matching on apps with many routes, or `SmartRouter` to auto-select between the two based on the registered route shape at first lookup. Each router accepts an optional `cache` for memoizing lookups — opt-in via `LruCache` (or any `ICache` implementation); pass `null` to disable.
127
+
128
+ ```typescript
129
+ import { App, TrieRouter, LruCache, defineCoreHandler } from 'routup';
130
+
131
+ const app = new App({
132
+ router: new TrieRouter({ cache: new LruCache() }), // omit `cache` for no memoization
133
+ });
134
+ ```
135
+
136
+ ### Timeouts and cancellation
137
+
138
+ Configure a global timeout for the whole pipeline, a default per-handler timeout, or both. When a deadline fires, `event.signal` is aborted so handlers can cooperatively cancel signal-aware work; if nothing recovers in time, routup returns `408 Request Timeout`.
139
+
140
+ ```typescript
141
+ const app = new App({
142
+ timeout: 30_000, // entire request
143
+ handlerTimeout: 5_000, // default per handler; handlers can narrow further
144
+ });
145
+
146
+ app.get('/fetch', defineCoreHandler(async (event) => {
147
+ const res = await fetch('https://api.example.com', { signal: event.signal });
148
+ return res.json();
149
+ }));
150
+ ```
151
+
114
152
  ### Runtimes
115
153
 
116
154
  Routup runs on Node.js, Bun, Deno, and Cloudflare Workers. In most cases, import from `routup`:
117
155
 
118
156
  ```typescript
119
- import { Router, defineCoreHandler, serve } from 'routup';
157
+ import { App, defineCoreHandler, serve } from 'routup';
120
158
 
121
- const router = new Router();
122
- router.get('/', defineCoreHandler(() => 'Hello, World!'));
123
- serve(router, { port: 3000 });
159
+ const app = new App();
160
+ app.get('/', defineCoreHandler(() => 'Hello, World!'));
161
+ serve(app, { port: 3000 });
124
162
  ```
125
163
 
126
164
  For runtime-specific APIs (e.g. `toNodeHandler`), use the corresponding entrypoint like `routup/node`.
127
165
 
166
+ ## Templates
167
+
168
+ Scaffold a new project from any starter in [`routup/templates`](https://github.com/routup/templates) with [`degit`](https://github.com/Rich-Harris/degit):
169
+
170
+ ```bash
171
+ npx degit routup/templates/node-api my-app
172
+ ```
173
+
174
+ | Template | Runtime | Highlights |
175
+ |----------|---------|------------|
176
+ | [node-api](https://github.com/routup/templates/tree/master/node-api) | Node.js >=22 | JSON API with `@routup/body` |
177
+ | [cloudflare-worker](https://github.com/routup/templates/tree/master/cloudflare-worker) | Cloudflare Workers | Configured with `wrangler` |
178
+ | [bun-decorators](https://github.com/routup/templates/tree/master/bun-decorators) | Bun | Class-based routing via `@routup/decorators` |
179
+
128
180
  ## Plugins
129
181
 
130
182
  Routup is minimalistic by design. [Plugins](https://github.com/routup/plugins) extend the framework with additional functionality.
@@ -135,27 +187,34 @@ Routup is minimalistic by design. [Plugins](https://github.com/routup/plugins) e
135
187
  | [basic](https://github.com/routup/plugins/tree/master/packages/basic) | Bundle of body, cookie, and query plugins |
136
188
  | [body](https://github.com/routup/plugins/tree/master/packages/body) | Read and parse the request body |
137
189
  | [cookie](https://github.com/routup/plugins/tree/master/packages/cookie) | Read and parse request cookies |
190
+ | [cors](https://github.com/routup/plugins/tree/master/packages/cors) | Cross-Origin Resource Sharing (CORS) middleware |
138
191
  | [decorators](https://github.com/routup/plugins/tree/master/packages/decorators) | Class, method, and parameter decorators |
192
+ | [i18n](https://github.com/routup/plugins/tree/master/packages/i18n) | Translation and internationalization |
193
+ | [logger](https://github.com/routup/plugins/tree/master/packages/logger) | HTTP request logger with morgan-compatible tokens and presets |
139
194
  | [prometheus](https://github.com/routup/plugins/tree/master/packages/prometheus) | Collect and serve Prometheus metrics |
140
195
  | [query](https://github.com/routup/plugins/tree/master/packages/query) | Parse URL query strings |
141
196
  | [rate-limit](https://github.com/routup/plugins/tree/master/packages/rate-limit) | Rate limit incoming requests |
142
197
  | [rate-limit-redis](https://github.com/routup/plugins/tree/master/packages/rate-limit-redis) | Redis adapter for rate-limit |
143
- | [swagger](https://github.com/routup/plugins/tree/master/packages/swagger) | Serve Swagger/OpenAPI docs |
144
-
145
- ## Benchmarks
146
-
147
- > **Note:** These benchmarks were recorded with routup v4 (Node.js 18, Sep 2023). Updated v5 benchmarks will follow.
148
-
149
- | Package | Requests/s | Latency (ms) | Throughput/MB |
150
- |:-----------|:-----------:|-------------:|--------------:|
151
- | http | 61062 | 15.87 | 10.89 |
152
- | fastify | 59679 | 16.26 | 10.70 |
153
- | koa | 45763 | 21.35 | 8.16 |
154
- | **routup** | 44588 | 21.91 | 9.02 |
155
- | hapi | 41374 | 23.67 | 7.38 |
156
- | express | 13376 | 74.18 | 2.39 |
157
-
158
- To run benchmarks yourself, see the [benchmarks](https://github.com/routup/benchmarks) repository.
198
+ | [swagger-ui](https://github.com/routup/plugins/tree/master/packages/swagger-ui) | Mount swagger-ui-dist on any path |
199
+
200
+ ## Comparison
201
+
202
+ How routup stacks up against other popular Node.js routing frameworks. This is a best-effort summary; check each project's docs for the full picture.
203
+
204
+ | | routup | [Hono](https://hono.dev) | [Express](https://expressjs.com) | [Fastify](https://fastify.dev) |
205
+ |-----------------------------------------|-------------------|--------------------------|----------------------------------|--------------------------------|
206
+ | **Runtimes** | Node, Bun, Deno, Cloudflare, Service Worker | Node, Bun, Deno, Cloudflare, Lambda, Vercel | Node | Node |
207
+ | **Web-standard `Request` / `Response`** || | | ❌ |
208
+ | **Return-based handlers** || | | ❌ |
209
+ | **TypeScript-first** | || community types | |
210
+ | **Tree-shakeable helpers** || | | ❌ |
211
+ | **Onion middleware (`next()`)** || | linear `next()` | lifecycle hooks |
212
+ | **Pluggable router (linear / trie)** | ✅ linear, trie, or auto-select | trie only | linear only | radix only |
213
+ | **Built-in ETag + 304** | | ❌ | via plugin | via plugin |
214
+ | **Per-handler timeout + `AbortSignal`** | ✅ | ❌ | ❌ | server-level |
215
+ | **Class-based routes (decorators)** | ✅ via plugin | ❌ | ❌ | ❌ |
216
+ | **Express middleware bridge** | ✅ `fromNodeHandler` | ❌ | n/a | limited |
217
+ | **Schema validation built-in** | ❌ | ❌ | ❌ | ✅ |
159
218
 
160
219
  ## Contributing
161
220
 
package/dist/bun.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as RouterPathNode, $t as RoutupError, A as sendFile, At as Handler, B as EventStreamOptions, Bt as Path, C as sendRedirect, Ct as fromNodeHandler, D as SendFileDisposition, Dt as defineCoreHandler, E as SendFileContentOptions, Et as NodeMiddleware, F as setResponseHeaderInline, Ft as HandlerBaseOptions, G as setResponseCacheHeaders, Gt as RoutupEvent, H as EventStreamListener, Ht as PathMatcherOptions, I as appendResponseHeader, It as HandlerSymbol, J as Router, Jt as NextFn, K as isError, Kt as RoutupEventCreateContext, L as appendResponseHeaderDirective, Lt as HandlerType, M as sendAccepted, Mt as defineErrorHandler, N as setResponseHeaderContentType, Nt as ErrorHandler, O as SendFileOptions, Ot as CoreHandler, P as setResponseHeaderAttachment, Pt as ErrorHandlerOptions, Q as RouterOptionsInput, Qt as HTTPErrorInput, R as serializeEventStreamMessage, Rt as isPath, S as sendStream, St as WebHandlerProvider, T as SendFileContent, Tt as NodeHandler, U as EventStreamMessage, Ut as IDispatcher, V as createEventStream, Vt as PathMatcherExecResult, W as ResponseCacheHeadersOptions, Wt as IDispatcherEvent, X as IRouter, Xt as RoutupResponse, Y as DispatcherEvent, Yt as RoutupRequest, Z as RouterOptions, Zt as ErrorSymbol, _ as getRequestAcceptableContentTypes, _t as isHandlerOptions, a as RequestIpOptions, at as Plugin, b as toResponse, bt as fromWebHandler, c as getRequestHostName, ct as PluginNotInstalledError, d as getRequestAcceptableLanguages, dt as isPluginError, en as HeaderName, et as RouterPipelineContext, f as getRequestAcceptableEncoding, ft as PluginError, g as getRequestAcceptableContentType, gt as isHandler, h as getRequestAcceptableCharsets, ht as matchHandlerMethod, i as useRequestNegotiator, it as isPlugin, j as sendCreated, jt as HandlerOptions, k as SendFileStats, kt as CoreHandlerOptions, l as matchRequestContentType, lt as PluginInstallError, m as getRequestAcceptableCharset, mt as buildHandlerPathMatcher, n as RequestProtocolOptions, nt as StackHandlerEntry, o as getRequestIP, ot as PluginInstallContext, p as getRequestAcceptableEncodings, pt as PluginErrorCode, q as createError, qt as IRoutupEvent, r as getRequestProtocol, rt as StackRouterEntry, s as RequestHostNameOptions, st as PluginInstallFn, t as normalizeRouterOptions, tn as MethodName, tt as StackEntry, u as getRequestAcceptableLanguage, ut as PluginAlreadyInstalledError, v as getRequestHeader, vt as isWebHandler, w as sendFormat, wt as fromNodeMiddleware, x as setResponseContentTypeByFileName, xt as WebHandler, y as isRequestCacheable, yt as isWebHandlerProvider, z as EventStreamHandle, zt as PathMatcher } from "./index-CvJhS_a6.mjs";
1
+ import { $ as createError, $t as HandlerSymbol, A as sendFormat, At as isWebHandlerProvider, B as setResponseHeaderAttachment, Bt as CoreHandlerOptions, C as getRequestAcceptableContentTypes, Ct as isPluginError, D as setResponseContentTypeByFileName, Dt as isHandler, E as toResponse, Et as matchHandlerMethod, F as SendFileStats, Ft as fromNodeMiddleware, G as EventStreamHandle, Gt as ErrorHandlerOptions, H as appendResponseHeader, Ht as HandlerOptions, I as sendFile, It as NodeHandler, J as EventStreamListener, Jt as PathMatcher, K as EventStreamOptions, Kt as HandlerBaseOptions, L as sendCreated, Lt as NodeMiddleware, M as SendFileContentOptions, Mt as WebHandler, N as SendFileDisposition, Nt as WebHandlerProvider, O as sendStream, Ot as isHandlerOptions, P as SendFileOptions, Pt as fromNodeHandler, Q as isError, Qt as PathMatcherOptions, R as sendAccepted, Rt as defineCoreHandler, S as getRequestAcceptableContentType, St as PluginAlreadyInstalledError, T as isRequestCacheable, Tt as PluginErrorCode, U as appendResponseHeaderDirective, Ut as defineErrorHandler, V as setResponseHeaderInline, Vt as Handler, W as serializeEventStreamMessage, Wt as ErrorHandler, X as ResponseCacheHeadersOptions, Xt as Path, Y as EventStreamMessage, Yt as IPathMatcher, Z as setResponseCacheHeaders, Zt as PathMatcherExecResult, _ as getRequestAcceptableLanguages, _t as Plugin, a as SmartRouter, an as AppEventCreateContext, at as HandlerRouteEntry, b as getRequestAcceptableCharset, bt as PluginNotInstalledError, c as RequestProtocolOptions, cn as IAppEvent, ct as BaseRouterOptions, d as RequestIpOptions, dn as MethodName, dt as Route, en as HandlerType, et as AppContext, f as getRequestIP, fn as MethodNameLike, ft as RouteMatch, g as getRequestAcceptableLanguage, gt as isPlugin, h as matchRequestContentType, hn as HTTPErrorInput, ht as ICache, i as TrieRouter, in as AppEvent, it as AppRouteEntry, j as SendFileContent, jt as fromWebHandler, k as sendRedirect, kt as isWebHandler, l as getRequestProtocol, ln as NextFn, lt as IRouter, m as getRequestHostName, mn as ErrorSymbol, mt as LruCacheOptions, n as App, nn as IDispatcher, nt as AppOptionsInput, o as SmartRouterOptions, on as AppRequest, ot as IApp, p as RequestHostNameOptions, pn as AppError, pt as LruCache, q as createEventStream, qt as isPath, r as buildRoutePathMatcher, rn as IDispatcherEvent, rt as AppPipelineContext, s as LinearRouter, sn as AppResponse, st as RouteEntry, t as normalizeAppOptions, tn as DispatcherEvent, tt as AppOptions, u as useRequestNegotiator, un as HeaderName, ut as ObjectLiteral, v as getRequestAcceptableEncoding, vt as PluginInstallContext, w as getRequestHeader, wt as PluginError, x as getRequestAcceptableCharsets, xt as PluginInstallError, y as getRequestAcceptableEncodings, yt as PluginInstallFn, z as setResponseHeaderContentType, zt as CoreHandler } from "./index-kxLRw2Wc.mjs";
2
2
  import { Server, ServerOptions } from "srvx";
3
3
 
4
4
  //#region src/_entries/bun.d.ts
5
- declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
5
+ declare function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server;
6
6
  //#endregion
7
- export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, StackEntry, StackHandlerEntry, StackRouterEntry, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
7
+ export { App, AppContext, AppError, AppEvent, AppEventCreateContext, AppOptions, AppOptionsInput, AppPipelineContext, AppRequest, AppResponse, AppRouteEntry, BaseRouterOptions, CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerRouteEntry, HandlerSymbol, HandlerType, HeaderName, IApp, IAppEvent, ICache, IDispatcher, IDispatcherEvent, IPathMatcher, IRouter, LinearRouter, LruCache, LruCacheOptions, MethodName, MethodNameLike, NextFn, NodeHandler, NodeMiddleware, ObjectLiteral, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Route, RouteEntry, RouteMatch, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, SmartRouter, SmartRouterOptions, TrieRouter, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
8
8
  //# sourceMappingURL=bun.d.mts.map
package/dist/bun.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { $ as setResponseHeaderAttachment, A as Handler, B as sendRedirect, C as fromWebHandler, D as fromNodeMiddleware, E as fromNodeHandler, F as HandlerSymbol, G as getRequestHeader, H as getRequestAcceptableContentType, I as HandlerType, J as sendAccepted, K as sendFile, L as DispatcherEvent, M as matchHandlerMethod, N as isPath, O as defineErrorHandler, P as PathMatcher, Q as setResponseHeaderContentType, R as RoutupEvent, S as isHandlerOptions, T as isWebHandlerProvider, U as getRequestAcceptableContentTypes, V as sendFormat, W as useRequestNegotiator, X as createError, Y as toResponse, Z as isError, _ as getRequestAcceptableEncodings, a as PluginInstallError, at as serializeEventStreamMessage, b as isRequestCacheable, c as isPluginError, ct as setResponseCacheHeaders, d as getRequestIP, et as setResponseHeaderInline, f as getRequestHostName, g as getRequestAcceptableEncoding, h as getRequestAcceptableLanguages, i as PluginNotInstalledError, it as createEventStream, j as buildHandlerPathMatcher, k as defineCoreHandler, l as PluginErrorCode, lt as HeaderName, m as getRequestAcceptableLanguage, n as normalizeRouterOptions, nt as appendResponseHeader, o as PluginAlreadyInstalledError, ot as ErrorSymbol, p as matchRequestContentType, q as sendCreated, r as isPlugin, rt as appendResponseHeaderDirective, s as PluginError, st as RoutupError, t as Router, tt as setResponseContentTypeByFileName, u as getRequestProtocol, ut as MethodName, v as getRequestAcceptableCharset, w as isWebHandler, x as isHandler, y as getRequestAcceptableCharsets, z as sendStream } from "./src-DFLGrih4.mjs";
1
+ import { $ as isError, A as fromWebHandler, B as DispatcherEvent, C as getRequestAcceptableEncodings, D as matchHandlerMethod, E as isRequestCacheable, F as defineErrorHandler, G as getRequestAcceptableContentTypes, H as sendRedirect, I as defineCoreHandler, J as sendFile, K as useRequestNegotiator, L as Handler, M as isWebHandlerProvider, N as fromNodeHandler, O as isHandler, P as fromNodeMiddleware, Q as createError, R as HandlerSymbol, S as getRequestAcceptableEncoding, T as getRequestAcceptableCharsets, U as sendFormat, V as sendStream, W as getRequestAcceptableContentType, X as sendAccepted, Y as sendCreated, Z as toResponse, _ as getRequestIP, a as LinearRouter, at as appendResponseHeaderDirective, b as getRequestAcceptableLanguage, c as PluginNotInstalledError, ct as AppError, d as PluginError, dt as AppEvent, et as setResponseHeaderContentType, f as isPluginError, ft as HeaderName, g as getRequestProtocol, h as PathMatcher, i as TrieRouter, it as appendResponseHeader, j as isWebHandler, k as isHandlerOptions, l as PluginInstallError, lt as ErrorSymbol, m as isPath, mt as LruCache, n as normalizeAppOptions, nt as setResponseHeaderInline, o as buildRoutePathMatcher, ot as createEventStream, p as PluginErrorCode, pt as MethodName, q as getRequestHeader, r as SmartRouter, rt as setResponseContentTypeByFileName, s as isPlugin, st as serializeEventStreamMessage, t as App, tt as setResponseHeaderAttachment, u as PluginAlreadyInstalledError, ut as setResponseCacheHeaders, v as getRequestHostName, w as getRequestAcceptableCharset, x as getRequestAcceptableLanguages, y as matchRequestContentType, z as HandlerType } from "./src-gmPicCWT.mjs";
2
2
  import { serve as serve$1 } from "srvx/bun";
3
3
  //#region src/_entries/bun.ts
4
- function serve(router, options) {
4
+ function serve(app, options) {
5
5
  return serve$1({
6
- fetch: router.fetch.bind(router),
6
+ fetch: app.fetch.bind(app),
7
7
  ...options
8
8
  });
9
9
  }
10
10
  //#endregion
11
- export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
11
+ export { App, AppError, AppEvent, DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, LinearRouter, LruCache, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, SmartRouter, TrieRouter, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
12
12
 
13
13
  //# sourceMappingURL=bun.mjs.map
package/dist/bun.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bun.mjs","names":["srvxServe"],"sources":["../src/_entries/bun.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/bun';\nimport type { Router } from '../router/module.ts';\n\nexport * from '../index.ts';\n\nexport function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: router.fetch.bind(router), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,QAAgB,SAAgD;CAClF,OAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
1
+ {"version":3,"file":"bun.mjs","names":["srvxServe"],"sources":["../src/_entries/bun.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/bun';\nimport type { IApp } from '../app/types.ts';\n\nexport * from '../index.ts';\n\nexport function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: app.fetch.bind(app), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,KAAW,SAAgD;CAC7E,OAAOA,QAAU;EAAE,OAAO,IAAI,MAAM,KAAK,IAAI;EAAE,GAAG;EAAS,CAAC"}
@@ -1,8 +1,8 @@
1
- import { $ as RouterPathNode, $t as RoutupError, A as sendFile, At as Handler, B as EventStreamOptions, Bt as Path, C as sendRedirect, Ct as fromNodeHandler, D as SendFileDisposition, Dt as defineCoreHandler, E as SendFileContentOptions, Et as NodeMiddleware, F as setResponseHeaderInline, Ft as HandlerBaseOptions, G as setResponseCacheHeaders, Gt as RoutupEvent, H as EventStreamListener, Ht as PathMatcherOptions, I as appendResponseHeader, It as HandlerSymbol, J as Router, Jt as NextFn, K as isError, Kt as RoutupEventCreateContext, L as appendResponseHeaderDirective, Lt as HandlerType, M as sendAccepted, Mt as defineErrorHandler, N as setResponseHeaderContentType, Nt as ErrorHandler, O as SendFileOptions, Ot as CoreHandler, P as setResponseHeaderAttachment, Pt as ErrorHandlerOptions, Q as RouterOptionsInput, Qt as HTTPErrorInput, R as serializeEventStreamMessage, Rt as isPath, S as sendStream, St as WebHandlerProvider, T as SendFileContent, Tt as NodeHandler, U as EventStreamMessage, Ut as IDispatcher, V as createEventStream, Vt as PathMatcherExecResult, W as ResponseCacheHeadersOptions, Wt as IDispatcherEvent, X as IRouter, Xt as RoutupResponse, Y as DispatcherEvent, Yt as RoutupRequest, Z as RouterOptions, Zt as ErrorSymbol, _ as getRequestAcceptableContentTypes, _t as isHandlerOptions, a as RequestIpOptions, at as Plugin, b as toResponse, bt as fromWebHandler, c as getRequestHostName, ct as PluginNotInstalledError, d as getRequestAcceptableLanguages, dt as isPluginError, en as HeaderName, et as RouterPipelineContext, f as getRequestAcceptableEncoding, ft as PluginError, g as getRequestAcceptableContentType, gt as isHandler, h as getRequestAcceptableCharsets, ht as matchHandlerMethod, i as useRequestNegotiator, it as isPlugin, j as sendCreated, jt as HandlerOptions, k as SendFileStats, kt as CoreHandlerOptions, l as matchRequestContentType, lt as PluginInstallError, m as getRequestAcceptableCharset, mt as buildHandlerPathMatcher, n as RequestProtocolOptions, nt as StackHandlerEntry, o as getRequestIP, ot as PluginInstallContext, p as getRequestAcceptableEncodings, pt as PluginErrorCode, q as createError, qt as IRoutupEvent, r as getRequestProtocol, rt as StackRouterEntry, s as RequestHostNameOptions, st as PluginInstallFn, t as normalizeRouterOptions, tn as MethodName, tt as StackEntry, u as getRequestAcceptableLanguage, ut as PluginAlreadyInstalledError, v as getRequestHeader, vt as isWebHandler, w as sendFormat, wt as fromNodeMiddleware, x as setResponseContentTypeByFileName, xt as WebHandler, y as isRequestCacheable, yt as isWebHandlerProvider, z as EventStreamHandle, zt as PathMatcher } from "./index-CvJhS_a6.mjs";
1
+ import { $ as createError, $t as HandlerSymbol, A as sendFormat, At as isWebHandlerProvider, B as setResponseHeaderAttachment, Bt as CoreHandlerOptions, C as getRequestAcceptableContentTypes, Ct as isPluginError, D as setResponseContentTypeByFileName, Dt as isHandler, E as toResponse, Et as matchHandlerMethod, F as SendFileStats, Ft as fromNodeMiddleware, G as EventStreamHandle, Gt as ErrorHandlerOptions, H as appendResponseHeader, Ht as HandlerOptions, I as sendFile, It as NodeHandler, J as EventStreamListener, Jt as PathMatcher, K as EventStreamOptions, Kt as HandlerBaseOptions, L as sendCreated, Lt as NodeMiddleware, M as SendFileContentOptions, Mt as WebHandler, N as SendFileDisposition, Nt as WebHandlerProvider, O as sendStream, Ot as isHandlerOptions, P as SendFileOptions, Pt as fromNodeHandler, Q as isError, Qt as PathMatcherOptions, R as sendAccepted, Rt as defineCoreHandler, S as getRequestAcceptableContentType, St as PluginAlreadyInstalledError, T as isRequestCacheable, Tt as PluginErrorCode, U as appendResponseHeaderDirective, Ut as defineErrorHandler, V as setResponseHeaderInline, Vt as Handler, W as serializeEventStreamMessage, Wt as ErrorHandler, X as ResponseCacheHeadersOptions, Xt as Path, Y as EventStreamMessage, Yt as IPathMatcher, Z as setResponseCacheHeaders, Zt as PathMatcherExecResult, _ as getRequestAcceptableLanguages, _t as Plugin, a as SmartRouter, an as AppEventCreateContext, at as HandlerRouteEntry, b as getRequestAcceptableCharset, bt as PluginNotInstalledError, c as RequestProtocolOptions, cn as IAppEvent, ct as BaseRouterOptions, d as RequestIpOptions, dn as MethodName, dt as Route, en as HandlerType, et as AppContext, f as getRequestIP, fn as MethodNameLike, ft as RouteMatch, g as getRequestAcceptableLanguage, gt as isPlugin, h as matchRequestContentType, hn as HTTPErrorInput, ht as ICache, i as TrieRouter, in as AppEvent, it as AppRouteEntry, j as SendFileContent, jt as fromWebHandler, k as sendRedirect, kt as isWebHandler, l as getRequestProtocol, ln as NextFn, lt as IRouter, m as getRequestHostName, mn as ErrorSymbol, mt as LruCacheOptions, n as App, nn as IDispatcher, nt as AppOptionsInput, o as SmartRouterOptions, on as AppRequest, ot as IApp, p as RequestHostNameOptions, pn as AppError, pt as LruCache, q as createEventStream, qt as isPath, r as buildRoutePathMatcher, rn as IDispatcherEvent, rt as AppPipelineContext, s as LinearRouter, sn as AppResponse, st as RouteEntry, t as normalizeAppOptions, tn as DispatcherEvent, tt as AppOptions, u as useRequestNegotiator, un as HeaderName, ut as ObjectLiteral, v as getRequestAcceptableEncoding, vt as PluginInstallContext, w as getRequestHeader, wt as PluginError, x as getRequestAcceptableCharsets, xt as PluginInstallError, y as getRequestAcceptableEncodings, yt as PluginInstallFn, z as setResponseHeaderContentType, zt as CoreHandler } from "./index-kxLRw2Wc.mjs";
2
2
  import { Server, ServerOptions } from "srvx";
3
3
 
4
4
  //#region src/_entries/cloudflare.d.ts
5
- declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
5
+ declare function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server;
6
6
  //#endregion
7
- export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, StackEntry, StackHandlerEntry, StackRouterEntry, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
7
+ export { App, AppContext, AppError, AppEvent, AppEventCreateContext, AppOptions, AppOptionsInput, AppPipelineContext, AppRequest, AppResponse, AppRouteEntry, BaseRouterOptions, CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerRouteEntry, HandlerSymbol, HandlerType, HeaderName, IApp, IAppEvent, ICache, IDispatcher, IDispatcherEvent, IPathMatcher, IRouter, LinearRouter, LruCache, LruCacheOptions, MethodName, MethodNameLike, NextFn, NodeHandler, NodeMiddleware, ObjectLiteral, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Route, RouteEntry, RouteMatch, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, SmartRouter, SmartRouterOptions, TrieRouter, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
8
8
  //# sourceMappingURL=cloudflare.d.mts.map
@@ -1,13 +1,13 @@
1
- import { $ as setResponseHeaderAttachment, A as Handler, B as sendRedirect, C as fromWebHandler, D as fromNodeMiddleware, E as fromNodeHandler, F as HandlerSymbol, G as getRequestHeader, H as getRequestAcceptableContentType, I as HandlerType, J as sendAccepted, K as sendFile, L as DispatcherEvent, M as matchHandlerMethod, N as isPath, O as defineErrorHandler, P as PathMatcher, Q as setResponseHeaderContentType, R as RoutupEvent, S as isHandlerOptions, T as isWebHandlerProvider, U as getRequestAcceptableContentTypes, V as sendFormat, W as useRequestNegotiator, X as createError, Y as toResponse, Z as isError, _ as getRequestAcceptableEncodings, a as PluginInstallError, at as serializeEventStreamMessage, b as isRequestCacheable, c as isPluginError, ct as setResponseCacheHeaders, d as getRequestIP, et as setResponseHeaderInline, f as getRequestHostName, g as getRequestAcceptableEncoding, h as getRequestAcceptableLanguages, i as PluginNotInstalledError, it as createEventStream, j as buildHandlerPathMatcher, k as defineCoreHandler, l as PluginErrorCode, lt as HeaderName, m as getRequestAcceptableLanguage, n as normalizeRouterOptions, nt as appendResponseHeader, o as PluginAlreadyInstalledError, ot as ErrorSymbol, p as matchRequestContentType, q as sendCreated, r as isPlugin, rt as appendResponseHeaderDirective, s as PluginError, st as RoutupError, t as Router, tt as setResponseContentTypeByFileName, u as getRequestProtocol, ut as MethodName, v as getRequestAcceptableCharset, w as isWebHandler, x as isHandler, y as getRequestAcceptableCharsets, z as sendStream } from "./src-DFLGrih4.mjs";
1
+ import { $ as isError, A as fromWebHandler, B as DispatcherEvent, C as getRequestAcceptableEncodings, D as matchHandlerMethod, E as isRequestCacheable, F as defineErrorHandler, G as getRequestAcceptableContentTypes, H as sendRedirect, I as defineCoreHandler, J as sendFile, K as useRequestNegotiator, L as Handler, M as isWebHandlerProvider, N as fromNodeHandler, O as isHandler, P as fromNodeMiddleware, Q as createError, R as HandlerSymbol, S as getRequestAcceptableEncoding, T as getRequestAcceptableCharsets, U as sendFormat, V as sendStream, W as getRequestAcceptableContentType, X as sendAccepted, Y as sendCreated, Z as toResponse, _ as getRequestIP, a as LinearRouter, at as appendResponseHeaderDirective, b as getRequestAcceptableLanguage, c as PluginNotInstalledError, ct as AppError, d as PluginError, dt as AppEvent, et as setResponseHeaderContentType, f as isPluginError, ft as HeaderName, g as getRequestProtocol, h as PathMatcher, i as TrieRouter, it as appendResponseHeader, j as isWebHandler, k as isHandlerOptions, l as PluginInstallError, lt as ErrorSymbol, m as isPath, mt as LruCache, n as normalizeAppOptions, nt as setResponseHeaderInline, o as buildRoutePathMatcher, ot as createEventStream, p as PluginErrorCode, pt as MethodName, q as getRequestHeader, r as SmartRouter, rt as setResponseContentTypeByFileName, s as isPlugin, st as serializeEventStreamMessage, t as App, tt as setResponseHeaderAttachment, u as PluginAlreadyInstalledError, ut as setResponseCacheHeaders, v as getRequestHostName, w as getRequestAcceptableCharset, x as getRequestAcceptableLanguages, y as matchRequestContentType, z as HandlerType } from "./src-gmPicCWT.mjs";
2
2
  import { serve as serve$1 } from "srvx/cloudflare";
3
3
  //#region src/_entries/cloudflare.ts
4
- function serve(router, options) {
4
+ function serve(app, options) {
5
5
  return serve$1({
6
- fetch: router.fetch.bind(router),
6
+ fetch: app.fetch.bind(app),
7
7
  ...options
8
8
  });
9
9
  }
10
10
  //#endregion
11
- export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
11
+ export { App, AppError, AppEvent, DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, LinearRouter, LruCache, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, SmartRouter, TrieRouter, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
12
12
 
13
13
  //# sourceMappingURL=cloudflare.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare.mjs","names":["srvxServe"],"sources":["../src/_entries/cloudflare.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/cloudflare';\nimport type { Router } from '../router/module.ts';\n\nexport * from '../index.ts';\n\nexport function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: router.fetch.bind(router), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,QAAgB,SAAgD;CAClF,OAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
1
+ {"version":3,"file":"cloudflare.mjs","names":["srvxServe"],"sources":["../src/_entries/cloudflare.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/cloudflare';\nimport type { IApp } from '../app';\n\nexport * from '../index.ts';\n\nexport function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: app.fetch.bind(app), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,KAAW,SAAgD;CAC7E,OAAOA,QAAU;EAAE,OAAO,IAAI,MAAM,KAAK,IAAI;EAAE,GAAG;EAAS,CAAC"}
package/dist/deno.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as RouterPathNode, $t as RoutupError, A as sendFile, At as Handler, B as EventStreamOptions, Bt as Path, C as sendRedirect, Ct as fromNodeHandler, D as SendFileDisposition, Dt as defineCoreHandler, E as SendFileContentOptions, Et as NodeMiddleware, F as setResponseHeaderInline, Ft as HandlerBaseOptions, G as setResponseCacheHeaders, Gt as RoutupEvent, H as EventStreamListener, Ht as PathMatcherOptions, I as appendResponseHeader, It as HandlerSymbol, J as Router, Jt as NextFn, K as isError, Kt as RoutupEventCreateContext, L as appendResponseHeaderDirective, Lt as HandlerType, M as sendAccepted, Mt as defineErrorHandler, N as setResponseHeaderContentType, Nt as ErrorHandler, O as SendFileOptions, Ot as CoreHandler, P as setResponseHeaderAttachment, Pt as ErrorHandlerOptions, Q as RouterOptionsInput, Qt as HTTPErrorInput, R as serializeEventStreamMessage, Rt as isPath, S as sendStream, St as WebHandlerProvider, T as SendFileContent, Tt as NodeHandler, U as EventStreamMessage, Ut as IDispatcher, V as createEventStream, Vt as PathMatcherExecResult, W as ResponseCacheHeadersOptions, Wt as IDispatcherEvent, X as IRouter, Xt as RoutupResponse, Y as DispatcherEvent, Yt as RoutupRequest, Z as RouterOptions, Zt as ErrorSymbol, _ as getRequestAcceptableContentTypes, _t as isHandlerOptions, a as RequestIpOptions, at as Plugin, b as toResponse, bt as fromWebHandler, c as getRequestHostName, ct as PluginNotInstalledError, d as getRequestAcceptableLanguages, dt as isPluginError, en as HeaderName, et as RouterPipelineContext, f as getRequestAcceptableEncoding, ft as PluginError, g as getRequestAcceptableContentType, gt as isHandler, h as getRequestAcceptableCharsets, ht as matchHandlerMethod, i as useRequestNegotiator, it as isPlugin, j as sendCreated, jt as HandlerOptions, k as SendFileStats, kt as CoreHandlerOptions, l as matchRequestContentType, lt as PluginInstallError, m as getRequestAcceptableCharset, mt as buildHandlerPathMatcher, n as RequestProtocolOptions, nt as StackHandlerEntry, o as getRequestIP, ot as PluginInstallContext, p as getRequestAcceptableEncodings, pt as PluginErrorCode, q as createError, qt as IRoutupEvent, r as getRequestProtocol, rt as StackRouterEntry, s as RequestHostNameOptions, st as PluginInstallFn, t as normalizeRouterOptions, tn as MethodName, tt as StackEntry, u as getRequestAcceptableLanguage, ut as PluginAlreadyInstalledError, v as getRequestHeader, vt as isWebHandler, w as sendFormat, wt as fromNodeMiddleware, x as setResponseContentTypeByFileName, xt as WebHandler, y as isRequestCacheable, yt as isWebHandlerProvider, z as EventStreamHandle, zt as PathMatcher } from "./index-CvJhS_a6.mjs";
1
+ import { $ as createError, $t as HandlerSymbol, A as sendFormat, At as isWebHandlerProvider, B as setResponseHeaderAttachment, Bt as CoreHandlerOptions, C as getRequestAcceptableContentTypes, Ct as isPluginError, D as setResponseContentTypeByFileName, Dt as isHandler, E as toResponse, Et as matchHandlerMethod, F as SendFileStats, Ft as fromNodeMiddleware, G as EventStreamHandle, Gt as ErrorHandlerOptions, H as appendResponseHeader, Ht as HandlerOptions, I as sendFile, It as NodeHandler, J as EventStreamListener, Jt as PathMatcher, K as EventStreamOptions, Kt as HandlerBaseOptions, L as sendCreated, Lt as NodeMiddleware, M as SendFileContentOptions, Mt as WebHandler, N as SendFileDisposition, Nt as WebHandlerProvider, O as sendStream, Ot as isHandlerOptions, P as SendFileOptions, Pt as fromNodeHandler, Q as isError, Qt as PathMatcherOptions, R as sendAccepted, Rt as defineCoreHandler, S as getRequestAcceptableContentType, St as PluginAlreadyInstalledError, T as isRequestCacheable, Tt as PluginErrorCode, U as appendResponseHeaderDirective, Ut as defineErrorHandler, V as setResponseHeaderInline, Vt as Handler, W as serializeEventStreamMessage, Wt as ErrorHandler, X as ResponseCacheHeadersOptions, Xt as Path, Y as EventStreamMessage, Yt as IPathMatcher, Z as setResponseCacheHeaders, Zt as PathMatcherExecResult, _ as getRequestAcceptableLanguages, _t as Plugin, a as SmartRouter, an as AppEventCreateContext, at as HandlerRouteEntry, b as getRequestAcceptableCharset, bt as PluginNotInstalledError, c as RequestProtocolOptions, cn as IAppEvent, ct as BaseRouterOptions, d as RequestIpOptions, dn as MethodName, dt as Route, en as HandlerType, et as AppContext, f as getRequestIP, fn as MethodNameLike, ft as RouteMatch, g as getRequestAcceptableLanguage, gt as isPlugin, h as matchRequestContentType, hn as HTTPErrorInput, ht as ICache, i as TrieRouter, in as AppEvent, it as AppRouteEntry, j as SendFileContent, jt as fromWebHandler, k as sendRedirect, kt as isWebHandler, l as getRequestProtocol, ln as NextFn, lt as IRouter, m as getRequestHostName, mn as ErrorSymbol, mt as LruCacheOptions, n as App, nn as IDispatcher, nt as AppOptionsInput, o as SmartRouterOptions, on as AppRequest, ot as IApp, p as RequestHostNameOptions, pn as AppError, pt as LruCache, q as createEventStream, qt as isPath, r as buildRoutePathMatcher, rn as IDispatcherEvent, rt as AppPipelineContext, s as LinearRouter, sn as AppResponse, st as RouteEntry, t as normalizeAppOptions, tn as DispatcherEvent, tt as AppOptions, u as useRequestNegotiator, un as HeaderName, ut as ObjectLiteral, v as getRequestAcceptableEncoding, vt as PluginInstallContext, w as getRequestHeader, wt as PluginError, x as getRequestAcceptableCharsets, xt as PluginInstallError, y as getRequestAcceptableEncodings, yt as PluginInstallFn, z as setResponseHeaderContentType, zt as CoreHandler } from "./index-kxLRw2Wc.mjs";
2
2
  import { Server, ServerOptions } from "srvx";
3
3
 
4
4
  //#region src/_entries/deno.d.ts
5
- declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
5
+ declare function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server;
6
6
  //#endregion
7
- export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, StackEntry, StackHandlerEntry, StackRouterEntry, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
7
+ export { App, AppContext, AppError, AppEvent, AppEventCreateContext, AppOptions, AppOptionsInput, AppPipelineContext, AppRequest, AppResponse, AppRouteEntry, BaseRouterOptions, CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerRouteEntry, HandlerSymbol, HandlerType, HeaderName, IApp, IAppEvent, ICache, IDispatcher, IDispatcherEvent, IPathMatcher, IRouter, LinearRouter, LruCache, LruCacheOptions, MethodName, MethodNameLike, NextFn, NodeHandler, NodeMiddleware, ObjectLiteral, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Route, RouteEntry, RouteMatch, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, SmartRouter, SmartRouterOptions, TrieRouter, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
8
8
  //# sourceMappingURL=deno.d.mts.map
package/dist/deno.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { $ as setResponseHeaderAttachment, A as Handler, B as sendRedirect, C as fromWebHandler, D as fromNodeMiddleware, E as fromNodeHandler, F as HandlerSymbol, G as getRequestHeader, H as getRequestAcceptableContentType, I as HandlerType, J as sendAccepted, K as sendFile, L as DispatcherEvent, M as matchHandlerMethod, N as isPath, O as defineErrorHandler, P as PathMatcher, Q as setResponseHeaderContentType, R as RoutupEvent, S as isHandlerOptions, T as isWebHandlerProvider, U as getRequestAcceptableContentTypes, V as sendFormat, W as useRequestNegotiator, X as createError, Y as toResponse, Z as isError, _ as getRequestAcceptableEncodings, a as PluginInstallError, at as serializeEventStreamMessage, b as isRequestCacheable, c as isPluginError, ct as setResponseCacheHeaders, d as getRequestIP, et as setResponseHeaderInline, f as getRequestHostName, g as getRequestAcceptableEncoding, h as getRequestAcceptableLanguages, i as PluginNotInstalledError, it as createEventStream, j as buildHandlerPathMatcher, k as defineCoreHandler, l as PluginErrorCode, lt as HeaderName, m as getRequestAcceptableLanguage, n as normalizeRouterOptions, nt as appendResponseHeader, o as PluginAlreadyInstalledError, ot as ErrorSymbol, p as matchRequestContentType, q as sendCreated, r as isPlugin, rt as appendResponseHeaderDirective, s as PluginError, st as RoutupError, t as Router, tt as setResponseContentTypeByFileName, u as getRequestProtocol, ut as MethodName, v as getRequestAcceptableCharset, w as isWebHandler, x as isHandler, y as getRequestAcceptableCharsets, z as sendStream } from "./src-DFLGrih4.mjs";
1
+ import { $ as isError, A as fromWebHandler, B as DispatcherEvent, C as getRequestAcceptableEncodings, D as matchHandlerMethod, E as isRequestCacheable, F as defineErrorHandler, G as getRequestAcceptableContentTypes, H as sendRedirect, I as defineCoreHandler, J as sendFile, K as useRequestNegotiator, L as Handler, M as isWebHandlerProvider, N as fromNodeHandler, O as isHandler, P as fromNodeMiddleware, Q as createError, R as HandlerSymbol, S as getRequestAcceptableEncoding, T as getRequestAcceptableCharsets, U as sendFormat, V as sendStream, W as getRequestAcceptableContentType, X as sendAccepted, Y as sendCreated, Z as toResponse, _ as getRequestIP, a as LinearRouter, at as appendResponseHeaderDirective, b as getRequestAcceptableLanguage, c as PluginNotInstalledError, ct as AppError, d as PluginError, dt as AppEvent, et as setResponseHeaderContentType, f as isPluginError, ft as HeaderName, g as getRequestProtocol, h as PathMatcher, i as TrieRouter, it as appendResponseHeader, j as isWebHandler, k as isHandlerOptions, l as PluginInstallError, lt as ErrorSymbol, m as isPath, mt as LruCache, n as normalizeAppOptions, nt as setResponseHeaderInline, o as buildRoutePathMatcher, ot as createEventStream, p as PluginErrorCode, pt as MethodName, q as getRequestHeader, r as SmartRouter, rt as setResponseContentTypeByFileName, s as isPlugin, st as serializeEventStreamMessage, t as App, tt as setResponseHeaderAttachment, u as PluginAlreadyInstalledError, ut as setResponseCacheHeaders, v as getRequestHostName, w as getRequestAcceptableCharset, x as getRequestAcceptableLanguages, y as matchRequestContentType, z as HandlerType } from "./src-gmPicCWT.mjs";
2
2
  import { serve as serve$1 } from "srvx/deno";
3
3
  //#region src/_entries/deno.ts
4
- function serve(router, options) {
4
+ function serve(app, options) {
5
5
  return serve$1({
6
- fetch: router.fetch.bind(router),
6
+ fetch: app.fetch.bind(app),
7
7
  ...options
8
8
  });
9
9
  }
10
10
  //#endregion
11
- export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
11
+ export { App, AppError, AppEvent, DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, LinearRouter, LruCache, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, SmartRouter, TrieRouter, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
12
12
 
13
13
  //# sourceMappingURL=deno.mjs.map
package/dist/deno.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"deno.mjs","names":["srvxServe"],"sources":["../src/_entries/deno.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/deno';\nimport type { Router } from '../router/module.ts';\n\nexport * from '../index.ts';\n\nexport function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: router.fetch.bind(router), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,QAAgB,SAAgD;CAClF,OAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
1
+ {"version":3,"file":"deno.mjs","names":["srvxServe"],"sources":["../src/_entries/deno.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/deno';\nimport type { IApp } from '../app';\n\nexport * from '../index.ts';\n\nexport function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: app.fetch.bind(app), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,KAAW,SAAgD;CAC7E,OAAOA,QAAU;EAAE,OAAO,IAAI,MAAM,KAAK,IAAI;EAAE,GAAG;EAAS,CAAC"}
@@ -1,8 +1,8 @@
1
- import { $ as RouterPathNode, $t as RoutupError, A as sendFile, At as Handler, B as EventStreamOptions, Bt as Path, C as sendRedirect, Ct as fromNodeHandler, D as SendFileDisposition, Dt as defineCoreHandler, E as SendFileContentOptions, Et as NodeMiddleware, F as setResponseHeaderInline, Ft as HandlerBaseOptions, G as setResponseCacheHeaders, Gt as RoutupEvent, H as EventStreamListener, Ht as PathMatcherOptions, I as appendResponseHeader, It as HandlerSymbol, J as Router, Jt as NextFn, K as isError, Kt as RoutupEventCreateContext, L as appendResponseHeaderDirective, Lt as HandlerType, M as sendAccepted, Mt as defineErrorHandler, N as setResponseHeaderContentType, Nt as ErrorHandler, O as SendFileOptions, Ot as CoreHandler, P as setResponseHeaderAttachment, Pt as ErrorHandlerOptions, Q as RouterOptionsInput, Qt as HTTPErrorInput, R as serializeEventStreamMessage, Rt as isPath, S as sendStream, St as WebHandlerProvider, T as SendFileContent, Tt as NodeHandler, U as EventStreamMessage, Ut as IDispatcher, V as createEventStream, Vt as PathMatcherExecResult, W as ResponseCacheHeadersOptions, Wt as IDispatcherEvent, X as IRouter, Xt as RoutupResponse, Y as DispatcherEvent, Yt as RoutupRequest, Z as RouterOptions, Zt as ErrorSymbol, _ as getRequestAcceptableContentTypes, _t as isHandlerOptions, a as RequestIpOptions, at as Plugin, b as toResponse, bt as fromWebHandler, c as getRequestHostName, ct as PluginNotInstalledError, d as getRequestAcceptableLanguages, dt as isPluginError, en as HeaderName, et as RouterPipelineContext, f as getRequestAcceptableEncoding, ft as PluginError, g as getRequestAcceptableContentType, gt as isHandler, h as getRequestAcceptableCharsets, ht as matchHandlerMethod, i as useRequestNegotiator, it as isPlugin, j as sendCreated, jt as HandlerOptions, k as SendFileStats, kt as CoreHandlerOptions, l as matchRequestContentType, lt as PluginInstallError, m as getRequestAcceptableCharset, mt as buildHandlerPathMatcher, n as RequestProtocolOptions, nt as StackHandlerEntry, o as getRequestIP, ot as PluginInstallContext, p as getRequestAcceptableEncodings, pt as PluginErrorCode, q as createError, qt as IRoutupEvent, r as getRequestProtocol, rt as StackRouterEntry, s as RequestHostNameOptions, st as PluginInstallFn, t as normalizeRouterOptions, tn as MethodName, tt as StackEntry, u as getRequestAcceptableLanguage, ut as PluginAlreadyInstalledError, v as getRequestHeader, vt as isWebHandler, w as sendFormat, wt as fromNodeMiddleware, x as setResponseContentTypeByFileName, xt as WebHandler, y as isRequestCacheable, yt as isWebHandlerProvider, z as EventStreamHandle, zt as PathMatcher } from "./index-CvJhS_a6.mjs";
1
+ import { $ as createError, $t as HandlerSymbol, A as sendFormat, At as isWebHandlerProvider, B as setResponseHeaderAttachment, Bt as CoreHandlerOptions, C as getRequestAcceptableContentTypes, Ct as isPluginError, D as setResponseContentTypeByFileName, Dt as isHandler, E as toResponse, Et as matchHandlerMethod, F as SendFileStats, Ft as fromNodeMiddleware, G as EventStreamHandle, Gt as ErrorHandlerOptions, H as appendResponseHeader, Ht as HandlerOptions, I as sendFile, It as NodeHandler, J as EventStreamListener, Jt as PathMatcher, K as EventStreamOptions, Kt as HandlerBaseOptions, L as sendCreated, Lt as NodeMiddleware, M as SendFileContentOptions, Mt as WebHandler, N as SendFileDisposition, Nt as WebHandlerProvider, O as sendStream, Ot as isHandlerOptions, P as SendFileOptions, Pt as fromNodeHandler, Q as isError, Qt as PathMatcherOptions, R as sendAccepted, Rt as defineCoreHandler, S as getRequestAcceptableContentType, St as PluginAlreadyInstalledError, T as isRequestCacheable, Tt as PluginErrorCode, U as appendResponseHeaderDirective, Ut as defineErrorHandler, V as setResponseHeaderInline, Vt as Handler, W as serializeEventStreamMessage, Wt as ErrorHandler, X as ResponseCacheHeadersOptions, Xt as Path, Y as EventStreamMessage, Yt as IPathMatcher, Z as setResponseCacheHeaders, Zt as PathMatcherExecResult, _ as getRequestAcceptableLanguages, _t as Plugin, a as SmartRouter, an as AppEventCreateContext, at as HandlerRouteEntry, b as getRequestAcceptableCharset, bt as PluginNotInstalledError, c as RequestProtocolOptions, cn as IAppEvent, ct as BaseRouterOptions, d as RequestIpOptions, dn as MethodName, dt as Route, en as HandlerType, et as AppContext, f as getRequestIP, fn as MethodNameLike, ft as RouteMatch, g as getRequestAcceptableLanguage, gt as isPlugin, h as matchRequestContentType, hn as HTTPErrorInput, ht as ICache, i as TrieRouter, in as AppEvent, it as AppRouteEntry, j as SendFileContent, jt as fromWebHandler, k as sendRedirect, kt as isWebHandler, l as getRequestProtocol, ln as NextFn, lt as IRouter, m as getRequestHostName, mn as ErrorSymbol, mt as LruCacheOptions, n as App, nn as IDispatcher, nt as AppOptionsInput, o as SmartRouterOptions, on as AppRequest, ot as IApp, p as RequestHostNameOptions, pn as AppError, pt as LruCache, q as createEventStream, qt as isPath, r as buildRoutePathMatcher, rn as IDispatcherEvent, rt as AppPipelineContext, s as LinearRouter, sn as AppResponse, st as RouteEntry, t as normalizeAppOptions, tn as DispatcherEvent, tt as AppOptions, u as useRequestNegotiator, un as HeaderName, ut as ObjectLiteral, v as getRequestAcceptableEncoding, vt as PluginInstallContext, w as getRequestHeader, wt as PluginError, x as getRequestAcceptableCharsets, xt as PluginInstallError, y as getRequestAcceptableEncodings, yt as PluginInstallFn, z as setResponseHeaderContentType, zt as CoreHandler } from "./index-kxLRw2Wc.mjs";
2
2
  import { Server, ServerOptions } from "srvx";
3
3
 
4
4
  //#region src/_entries/generic.d.ts
5
- declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
5
+ declare function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server;
6
6
  //#endregion
7
- export { CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IDispatcherEvent, IRouter, IRoutupEvent, MethodName, NextFn, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterOptions, RouterOptionsInput, RouterPathNode, RouterPipelineContext, RoutupError, RoutupEvent, RoutupEventCreateContext, RoutupRequest, RoutupResponse, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, StackEntry, StackHandlerEntry, StackRouterEntry, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
7
+ export { App, AppContext, AppError, AppEvent, AppEventCreateContext, AppOptions, AppOptionsInput, AppPipelineContext, AppRequest, AppResponse, AppRouteEntry, BaseRouterOptions, CoreHandler, CoreHandlerOptions, DispatcherEvent, ErrorHandler, ErrorHandlerOptions, ErrorSymbol, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseOptions, HandlerOptions, HandlerRouteEntry, HandlerSymbol, HandlerType, HeaderName, IApp, IAppEvent, ICache, IDispatcher, IDispatcherEvent, IPathMatcher, IRouter, LinearRouter, LruCache, LruCacheOptions, MethodName, MethodNameLike, NextFn, NodeHandler, NodeMiddleware, ObjectLiteral, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallContext, PluginInstallError, PluginInstallFn, PluginNotInstalledError, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Route, RouteEntry, RouteMatch, SendFileContent, SendFileContentOptions, SendFileDisposition, SendFileOptions, SendFileStats, SmartRouter, SmartRouterOptions, TrieRouter, WebHandler, WebHandlerProvider, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
8
8
  //# sourceMappingURL=generic.d.mts.map
package/dist/generic.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { $ as setResponseHeaderAttachment, A as Handler, B as sendRedirect, C as fromWebHandler, D as fromNodeMiddleware, E as fromNodeHandler, F as HandlerSymbol, G as getRequestHeader, H as getRequestAcceptableContentType, I as HandlerType, J as sendAccepted, K as sendFile, L as DispatcherEvent, M as matchHandlerMethod, N as isPath, O as defineErrorHandler, P as PathMatcher, Q as setResponseHeaderContentType, R as RoutupEvent, S as isHandlerOptions, T as isWebHandlerProvider, U as getRequestAcceptableContentTypes, V as sendFormat, W as useRequestNegotiator, X as createError, Y as toResponse, Z as isError, _ as getRequestAcceptableEncodings, a as PluginInstallError, at as serializeEventStreamMessage, b as isRequestCacheable, c as isPluginError, ct as setResponseCacheHeaders, d as getRequestIP, et as setResponseHeaderInline, f as getRequestHostName, g as getRequestAcceptableEncoding, h as getRequestAcceptableLanguages, i as PluginNotInstalledError, it as createEventStream, j as buildHandlerPathMatcher, k as defineCoreHandler, l as PluginErrorCode, lt as HeaderName, m as getRequestAcceptableLanguage, n as normalizeRouterOptions, nt as appendResponseHeader, o as PluginAlreadyInstalledError, ot as ErrorSymbol, p as matchRequestContentType, q as sendCreated, r as isPlugin, rt as appendResponseHeaderDirective, s as PluginError, st as RoutupError, t as Router, tt as setResponseContentTypeByFileName, u as getRequestProtocol, ut as MethodName, v as getRequestAcceptableCharset, w as isWebHandler, x as isHandler, y as getRequestAcceptableCharsets, z as sendStream } from "./src-DFLGrih4.mjs";
1
+ import { $ as isError, A as fromWebHandler, B as DispatcherEvent, C as getRequestAcceptableEncodings, D as matchHandlerMethod, E as isRequestCacheable, F as defineErrorHandler, G as getRequestAcceptableContentTypes, H as sendRedirect, I as defineCoreHandler, J as sendFile, K as useRequestNegotiator, L as Handler, M as isWebHandlerProvider, N as fromNodeHandler, O as isHandler, P as fromNodeMiddleware, Q as createError, R as HandlerSymbol, S as getRequestAcceptableEncoding, T as getRequestAcceptableCharsets, U as sendFormat, V as sendStream, W as getRequestAcceptableContentType, X as sendAccepted, Y as sendCreated, Z as toResponse, _ as getRequestIP, a as LinearRouter, at as appendResponseHeaderDirective, b as getRequestAcceptableLanguage, c as PluginNotInstalledError, ct as AppError, d as PluginError, dt as AppEvent, et as setResponseHeaderContentType, f as isPluginError, ft as HeaderName, g as getRequestProtocol, h as PathMatcher, i as TrieRouter, it as appendResponseHeader, j as isWebHandler, k as isHandlerOptions, l as PluginInstallError, lt as ErrorSymbol, m as isPath, mt as LruCache, n as normalizeAppOptions, nt as setResponseHeaderInline, o as buildRoutePathMatcher, ot as createEventStream, p as PluginErrorCode, pt as MethodName, q as getRequestHeader, r as SmartRouter, rt as setResponseContentTypeByFileName, s as isPlugin, st as serializeEventStreamMessage, t as App, tt as setResponseHeaderAttachment, u as PluginAlreadyInstalledError, ut as setResponseCacheHeaders, v as getRequestHostName, w as getRequestAcceptableCharset, x as getRequestAcceptableLanguages, y as matchRequestContentType, z as HandlerType } from "./src-gmPicCWT.mjs";
2
2
  import { serve as serve$1 } from "srvx/generic";
3
3
  //#region src/_entries/generic.ts
4
- function serve(router, options) {
4
+ function serve(app, options) {
5
5
  return serve$1({
6
- fetch: router.fetch.bind(router),
6
+ fetch: app.fetch.bind(app),
7
7
  ...options
8
8
  });
9
9
  }
10
10
  //#endregion
11
- export { DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, buildHandlerPathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeRouterOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
11
+ export { App, AppError, AppEvent, DispatcherEvent, ErrorSymbol, Handler, HandlerSymbol, HandlerType, HeaderName, LinearRouter, LruCache, MethodName, PathMatcher, PluginAlreadyInstalledError, PluginError, PluginErrorCode, PluginInstallError, PluginNotInstalledError, SmartRouter, TrieRouter, appendResponseHeader, appendResponseHeaderDirective, buildRoutePathMatcher, createError, createEventStream, defineCoreHandler, defineErrorHandler, fromNodeHandler, fromNodeMiddleware, fromWebHandler, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerOptions, isPath, isPlugin, isPluginError, isRequestCacheable, isWebHandler, isWebHandlerProvider, matchHandlerMethod, matchRequestContentType, normalizeAppOptions, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseHeaderAttachment, setResponseHeaderContentType, setResponseHeaderInline, toResponse, useRequestNegotiator };
12
12
 
13
13
  //# sourceMappingURL=generic.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generic.mjs","names":["srvxServe"],"sources":["../src/_entries/generic.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/generic';\nimport type { Router } from '../router/module.ts';\n\nexport * from '../index.ts';\n\nexport function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: router.fetch.bind(router), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,QAAgB,SAAgD;CAClF,OAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
1
+ {"version":3,"file":"generic.mjs","names":["srvxServe"],"sources":["../src/_entries/generic.ts"],"sourcesContent":["import type { Server, ServerOptions } from 'srvx';\nimport { serve as srvxServe } from 'srvx/generic';\nimport type { IApp } from '../app';\n\nexport * from '../index.ts';\n\nexport function serve(app: IApp, options?: Omit<ServerOptions, 'fetch'>): Server {\n return srvxServe({ fetch: app.fetch.bind(app), ...options });\n}\n"],"mappings":";;;AAMA,SAAgB,MAAM,KAAW,SAAgD;CAC7E,OAAOA,QAAU;EAAE,OAAO,IAAI,MAAM,KAAK,IAAI;EAAE,GAAG;EAAS,CAAC"}