routup 4.1.0 → 5.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 +87 -134
- package/dist/bun.cjs +66 -0
- package/dist/bun.cjs.map +1 -0
- package/dist/bun.d.cts +8 -0
- package/dist/bun.d.mts +8 -0
- package/dist/bun.mjs +13 -0
- package/dist/bun.mjs.map +1 -0
- package/dist/cloudflare.cjs +66 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +8 -0
- package/dist/cloudflare.d.mts +8 -0
- package/dist/cloudflare.mjs +13 -0
- package/dist/cloudflare.mjs.map +1 -0
- package/dist/deno.cjs +66 -0
- package/dist/deno.cjs.map +1 -0
- package/dist/deno.d.cts +8 -0
- package/dist/deno.d.mts +8 -0
- package/dist/deno.mjs +13 -0
- package/dist/deno.mjs.map +1 -0
- package/dist/generic.cjs +66 -0
- package/dist/generic.cjs.map +1 -0
- package/dist/generic.d.cts +8 -0
- package/dist/generic.d.mts +8 -0
- package/dist/generic.mjs +13 -0
- package/dist/generic.mjs.map +1 -0
- package/dist/index-9K5FcIb3.d.cts +786 -0
- package/dist/index-B6F5CzQy.d.mts +786 -0
- package/dist/node.cjs +70 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +11 -0
- package/dist/node.d.mts +11 -0
- package/dist/node.mjs +16 -0
- package/dist/node.mjs.map +1 -0
- package/dist/service-worker.cjs +66 -0
- package/dist/service-worker.cjs.map +1 -0
- package/dist/service-worker.d.cts +10 -0
- package/dist/service-worker.d.mts +10 -0
- package/dist/service-worker.mjs +13 -0
- package/dist/service-worker.mjs.map +1 -0
- package/dist/src-C789deGE.mjs +1599 -0
- package/dist/src-C789deGE.mjs.map +1 -0
- package/dist/src-Ca2_b8P0.cjs +1939 -0
- package/dist/src-Ca2_b8P0.cjs.map +1 -0
- package/package.json +75 -34
- package/dist/adapters/index.d.ts +0 -3
- package/dist/adapters/node/index.d.ts +0 -1
- package/dist/adapters/node/module.d.ts +0 -6
- package/dist/adapters/raw/header.d.ts +0 -3
- package/dist/adapters/raw/index.d.ts +0 -3
- package/dist/adapters/raw/module.d.ts +0 -4
- package/dist/adapters/raw/type.d.ts +0 -18
- package/dist/adapters/web/index.d.ts +0 -2
- package/dist/adapters/web/module.d.ts +0 -4
- package/dist/adapters/web/type.d.ts +0 -3
- package/dist/constants.d.ts +0 -42
- package/dist/dispatcher/event/dispatch.d.ts +0 -4
- package/dist/dispatcher/event/error.d.ts +0 -5
- package/dist/dispatcher/event/index.d.ts +0 -5
- package/dist/dispatcher/event/is.d.ts +0 -3
- package/dist/dispatcher/event/module.d.ts +0 -56
- package/dist/dispatcher/event/types.d.ts +0 -9
- package/dist/dispatcher/index.d.ts +0 -2
- package/dist/dispatcher/type.d.ts +0 -4
- package/dist/error/create.d.ts +0 -11
- package/dist/error/index.d.ts +0 -3
- package/dist/error/is.d.ts +0 -2
- package/dist/error/module.d.ts +0 -3
- package/dist/handler/constants.d.ts +0 -5
- package/dist/handler/core/define.d.ts +0 -4
- package/dist/handler/core/index.d.ts +0 -2
- package/dist/handler/core/types.d.ts +0 -10
- package/dist/handler/error/define.d.ts +0 -4
- package/dist/handler/error/index.d.ts +0 -2
- package/dist/handler/error/types.d.ts +0 -11
- package/dist/handler/index.d.ts +0 -7
- package/dist/handler/is.d.ts +0 -4
- package/dist/handler/module.d.ts +0 -23
- package/dist/handler/types-base.d.ts +0 -10
- package/dist/handler/types.d.ts +0 -4
- package/dist/hook/constants.d.ts +0 -8
- package/dist/hook/index.d.ts +0 -3
- package/dist/hook/module.d.ts +0 -19
- package/dist/hook/types.d.ts +0 -5
- package/dist/index.cjs +0 -2314
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.mjs +0 -2235
- package/dist/index.mjs.map +0 -1
- package/dist/path/index.d.ts +0 -3
- package/dist/path/matcher.d.ts +0 -11
- package/dist/path/type.d.ts +0 -7
- package/dist/path/utils.d.ts +0 -2
- package/dist/plugin/index.d.ts +0 -2
- package/dist/plugin/is.d.ts +0 -2
- package/dist/plugin/types.d.ts +0 -23
- package/dist/request/helpers/cache.d.ts +0 -2
- package/dist/request/helpers/env.d.ts +0 -6
- package/dist/request/helpers/header-accept-charset.d.ts +0 -3
- package/dist/request/helpers/header-accept-encoding.d.ts +0 -3
- package/dist/request/helpers/header-accept-language.d.ts +0 -3
- package/dist/request/helpers/header-accept.d.ts +0 -3
- package/dist/request/helpers/header-content-type.d.ts +0 -2
- package/dist/request/helpers/header.d.ts +0 -4
- package/dist/request/helpers/hostname.d.ts +0 -7
- package/dist/request/helpers/http2.d.ts +0 -2
- package/dist/request/helpers/index.d.ts +0 -17
- package/dist/request/helpers/ip.d.ts +0 -7
- package/dist/request/helpers/mount-path.d.ts +0 -3
- package/dist/request/helpers/negotiator.d.ts +0 -3
- package/dist/request/helpers/params.d.ts +0 -5
- package/dist/request/helpers/path.d.ts +0 -2
- package/dist/request/helpers/protocol.d.ts +0 -8
- package/dist/request/helpers/router.d.ts +0 -3
- package/dist/request/index.d.ts +0 -3
- package/dist/request/module.d.ts +0 -3
- package/dist/request/types.d.ts +0 -12
- package/dist/response/helpers/cache.d.ts +0 -7
- package/dist/response/helpers/event-stream/factory.d.ts +0 -3
- package/dist/response/helpers/event-stream/index.d.ts +0 -2
- package/dist/response/helpers/event-stream/module.d.ts +0 -17
- package/dist/response/helpers/event-stream/types.d.ts +0 -24
- package/dist/response/helpers/event-stream/utils.d.ts +0 -2
- package/dist/response/helpers/gone.d.ts +0 -3
- package/dist/response/helpers/header-attachment.d.ts +0 -2
- package/dist/response/helpers/header-content-type.d.ts +0 -2
- package/dist/response/helpers/header.d.ts +0 -4
- package/dist/response/helpers/index.d.ts +0 -16
- package/dist/response/helpers/send-accepted.d.ts +0 -2
- package/dist/response/helpers/send-created.d.ts +0 -2
- package/dist/response/helpers/send-file.d.ts +0 -17
- package/dist/response/helpers/send-format.d.ts +0 -7
- package/dist/response/helpers/send-redirect.d.ts +0 -2
- package/dist/response/helpers/send-stream.d.ts +0 -3
- package/dist/response/helpers/send-web-blob.d.ts +0 -3
- package/dist/response/helpers/send-web-response.d.ts +0 -3
- package/dist/response/helpers/send.d.ts +0 -2
- package/dist/response/helpers/utils.d.ts +0 -2
- package/dist/response/index.d.ts +0 -3
- package/dist/response/module.d.ts +0 -3
- package/dist/response/types.d.ts +0 -3
- package/dist/router/constants.d.ts +0 -9
- package/dist/router/index.d.ts +0 -1
- package/dist/router/module.d.ts +0 -89
- package/dist/router/types.d.ts +0 -7
- package/dist/router/utils.d.ts +0 -3
- package/dist/router-options/index.d.ts +0 -2
- package/dist/router-options/module.d.ts +0 -4
- package/dist/router-options/transform.d.ts +0 -2
- package/dist/router-options/type.d.ts +0 -41
- package/dist/types.d.ts +0 -9
- package/dist/utils/cookie.d.ts +0 -1
- package/dist/utils/etag/index.d.ts +0 -3
- package/dist/utils/etag/module.d.ts +0 -11
- package/dist/utils/etag/type.d.ts +0 -15
- package/dist/utils/etag/utils.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -13
- package/dist/utils/is-instance.d.ts +0 -1
- package/dist/utils/method.d.ts +0 -3
- package/dist/utils/mime.d.ts +0 -2
- package/dist/utils/next.d.ts +0 -2
- package/dist/utils/object.d.ts +0 -3
- package/dist/utils/path.d.ts +0 -5
- package/dist/utils/promise.d.ts +0 -1
- package/dist/utils/stream.d.ts +0 -6
- package/dist/utils/trust-proxy/index.d.ts +0 -2
- package/dist/utils/trust-proxy/module.d.ts +0 -2
- package/dist/utils/trust-proxy/type.d.ts +0 -2
- package/dist/utils/url.d.ts +0 -7
- package/dist/utils/web.d.ts +0 -3
package/README.md
CHANGED
|
@@ -12,11 +12,8 @@
|
|
|
12
12
|
[](https://snyk.io/test/github/Tada5hi/routup)
|
|
13
13
|
[](https://conventionalcommits.org)
|
|
14
14
|
|
|
15
|
-
**Routup** is a
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
It can be used independently of the selected runtime environment (Node.Js, Bun, ... ) 🎉.
|
|
19
|
-
Moreover, it is even **228%** faster than Express ([more](#benchmarks)).
|
|
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.
|
|
20
17
|
|
|
21
18
|
**Table of Contents**
|
|
22
19
|
|
|
@@ -25,7 +22,6 @@ Moreover, it is even **228%** faster than Express ([more](#benchmarks)).
|
|
|
25
22
|
- [Documentation](#documentation)
|
|
26
23
|
- [Usage](#usage)
|
|
27
24
|
- [Plugins](#plugins)
|
|
28
|
-
- [Benchmarks](#benchmarks)
|
|
29
25
|
- [Contributing](#contributing)
|
|
30
26
|
- [License](#license)
|
|
31
27
|
|
|
@@ -37,17 +33,15 @@ npm install routup --save
|
|
|
37
33
|
|
|
38
34
|
## Features
|
|
39
35
|
|
|
40
|
-
- 🚀
|
|
41
|
-
- 📝
|
|
42
|
-
- ✨
|
|
43
|
-
- 📌
|
|
44
|
-
- 🔌
|
|
45
|
-
- 🧰
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- 🤏 minimalistic to fit into any solution with minimum overhead
|
|
50
|
-
- & much more
|
|
36
|
+
- 🚀 **Runtime agnostic** — Node.js, Bun, Deno, Cloudflare Workers
|
|
37
|
+
- 📝 **Return-based handlers** — return strings, objects, streams, or `Response` directly
|
|
38
|
+
- ✨ **Async middleware** — onion model with `event.next()`
|
|
39
|
+
- 📌 **Lifecycle hooks** — `request`, `response`, `error` for cross-cutting concerns
|
|
40
|
+
- 🔌 **Plugin system** — extend with reusable, installable plugins
|
|
41
|
+
- 🧰 **Tree-shakeable helpers** — import only what you use
|
|
42
|
+
- 📁 **Nestable routers** — modular route composition
|
|
43
|
+
- 👕 **TypeScript first** — fully typed API with generics
|
|
44
|
+
- 🤏 **Minimal footprint** — small core, no bloat
|
|
51
45
|
|
|
52
46
|
## Documentation
|
|
53
47
|
|
|
@@ -55,173 +49,132 @@ To read the docs, visit [https://routup.net](https://routup.net)
|
|
|
55
49
|
|
|
56
50
|
## Usage
|
|
57
51
|
|
|
58
|
-
The following examples are intended to give a small insight into the use of the framework.
|
|
59
|
-
However, it is highly recommended to read the [documentation](https://routup.net),
|
|
60
|
-
as all concepts and basics are taught there.
|
|
61
|
-
|
|
62
52
|
### Handlers
|
|
63
53
|
|
|
64
|
-
|
|
65
|
-
Core handler functions can have up to 3 arguments (req, res, next) whereas error handler functions can have up to 4 arguments (err, req, res, next).
|
|
66
|
-
This should be familiar to anyone who has used express before.
|
|
54
|
+
Handlers receive an event and return a value. Routup converts the return value to a Web `Response` automatically.
|
|
67
55
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
With the shorthand variant,
|
|
71
|
-
only the handler function is passed as argument to the **coreHandler** & **errorHandler** function.
|
|
56
|
+
**Shorthand**
|
|
72
57
|
|
|
73
58
|
```typescript
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
coreHandler,
|
|
77
|
-
createNodeDispatcher,
|
|
78
|
-
errorHandler,
|
|
79
|
-
Router,
|
|
80
|
-
useRequestParam
|
|
81
|
-
} from 'routup';
|
|
59
|
+
import { Router, coreHandler, errorHandler, serve } from 'routup';
|
|
82
60
|
|
|
83
61
|
const router = new Router();
|
|
84
62
|
|
|
85
63
|
router.get('/', coreHandler(() => 'Hello, World!'));
|
|
86
|
-
router.get('/greet/:name', coreHandler((
|
|
87
|
-
router.use(errorHandler((
|
|
64
|
+
router.get('/greet/:name', coreHandler((event) => `Hello, ${event.params.name}!`));
|
|
65
|
+
router.use(errorHandler((error) => ({ error: error.message })));
|
|
88
66
|
|
|
89
|
-
|
|
90
|
-
server.listen(3000)
|
|
67
|
+
serve(router, { port: 3000 });
|
|
91
68
|
```
|
|
92
69
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
The verbose variant is more complex, but offers the possibility to set additional information
|
|
96
|
-
like **path**, **method**, ... in the handler definition.
|
|
70
|
+
**Verbose**
|
|
97
71
|
|
|
98
72
|
```typescript
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
coreHandler,
|
|
102
|
-
createNodeDispatcher,
|
|
103
|
-
errorHandler,
|
|
104
|
-
Router,
|
|
105
|
-
useRequestParam
|
|
106
|
-
} from 'routup';
|
|
73
|
+
import { Router, coreHandler, serve } from 'routup';
|
|
107
74
|
|
|
108
75
|
const router = new Router();
|
|
109
76
|
|
|
110
|
-
router.
|
|
77
|
+
router.use(coreHandler({
|
|
111
78
|
path: '/',
|
|
79
|
+
method: 'GET',
|
|
112
80
|
fn: () => 'Hello, World!',
|
|
113
81
|
}));
|
|
114
82
|
|
|
115
|
-
router.
|
|
83
|
+
router.use(coreHandler({
|
|
116
84
|
path: '/greet/:name',
|
|
117
|
-
|
|
118
|
-
}
|
|
85
|
+
method: 'GET',
|
|
86
|
+
fn: (event) => `Hello, ${event.params.name}!`,
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
serve(router, { port: 3000 });
|
|
90
|
+
```
|
|
119
91
|
|
|
120
|
-
|
|
121
|
-
fn: (err) => `An error with statusCode ${err.statusCode} occured.`
|
|
122
|
-
}))
|
|
92
|
+
### Return Values
|
|
123
93
|
|
|
124
|
-
|
|
125
|
-
|
|
94
|
+
| Return type | Response |
|
|
95
|
+
|-------------|----------|
|
|
96
|
+
| `string` | `text/plain` |
|
|
97
|
+
| `object` / `array` | `application/json` |
|
|
98
|
+
| `Response` | Passed through as-is |
|
|
99
|
+
| `ReadableStream` | Streamed to client |
|
|
100
|
+
| `Blob` | Sent with blob's content type |
|
|
101
|
+
| `null` | Empty response (status from `event.response`) |
|
|
102
|
+
|
|
103
|
+
### Middleware
|
|
104
|
+
|
|
105
|
+
Middleware calls `event.next()` to continue the pipeline:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
router.use(coreHandler(async (event) => {
|
|
109
|
+
console.log(`${event.method} ${event.path}`);
|
|
110
|
+
return event.next();
|
|
111
|
+
}));
|
|
126
112
|
```
|
|
127
113
|
|
|
128
114
|
### Runtimes
|
|
129
115
|
|
|
130
|
-
|
|
131
|
-
These use the web dispatcher to submit requests based on the web api. Besides the node- & web-dispatcher,
|
|
132
|
-
there is also a plain dispatcher that underlies the web dispatcher, which can be controlled via a simple API.
|
|
133
|
-
|
|
134
|
-
**`Bun`**
|
|
116
|
+
Routup runs on any JavaScript runtime:
|
|
135
117
|
|
|
118
|
+
**Node.js**
|
|
136
119
|
```typescript
|
|
137
|
-
import {
|
|
138
|
-
coreHandler,
|
|
139
|
-
createWebDispatcher,
|
|
140
|
-
Router
|
|
141
|
-
} from 'routup';
|
|
120
|
+
import { Router, coreHandler, serve } from 'routup';
|
|
142
121
|
|
|
143
122
|
const router = new Router();
|
|
144
|
-
|
|
145
123
|
router.get('/', coreHandler(() => 'Hello, World!'));
|
|
124
|
+
serve(router, { port: 3000 });
|
|
125
|
+
```
|
|
146
126
|
|
|
147
|
-
|
|
127
|
+
**Bun**
|
|
128
|
+
```typescript
|
|
129
|
+
import { Router, coreHandler, serve } from 'routup/bun';
|
|
148
130
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
port: 3000,
|
|
154
|
-
});
|
|
131
|
+
const router = new Router();
|
|
132
|
+
router.get('/', coreHandler(() => 'Hello, World!'));
|
|
133
|
+
serve(router, { port: 3000 });
|
|
155
134
|
```
|
|
156
135
|
|
|
157
|
-
|
|
158
|
-
|
|
136
|
+
**Deno**
|
|
159
137
|
```typescript
|
|
160
|
-
import {
|
|
161
|
-
coreHandler,
|
|
162
|
-
createWebDispatcher,
|
|
163
|
-
Router
|
|
164
|
-
} from 'routup';
|
|
138
|
+
import { Router, coreHandler, serve } from 'routup/deno';
|
|
165
139
|
|
|
166
140
|
const router = new Router();
|
|
141
|
+
router.get('/', coreHandler(() => 'Hello, World!'));
|
|
142
|
+
serve(router, { port: 3000 });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Cloudflare Workers**
|
|
146
|
+
```typescript
|
|
147
|
+
import { Router, coreHandler } from 'routup/cloudflare';
|
|
167
148
|
|
|
149
|
+
const router = new Router();
|
|
168
150
|
router.get('/', coreHandler(() => 'Hello, World!'));
|
|
169
151
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const server = Deno.listen({
|
|
173
|
-
port: 3000
|
|
174
|
-
});
|
|
175
|
-
for await (const conn of server) {
|
|
176
|
-
const httpConn = Deno.serveHttp(conn);
|
|
177
|
-
|
|
178
|
-
for await (const requestEvent of httpConn) {
|
|
179
|
-
const response = await dispatch(
|
|
180
|
-
requestEvent.request
|
|
181
|
-
);
|
|
182
|
-
requestEvent.respondWith(response);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
152
|
+
export default { fetch: (request) => router.fetch(request) };
|
|
185
153
|
```
|
|
186
154
|
|
|
187
155
|
## Plugins
|
|
188
156
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
|
194
|
-
|
|
195
|
-
| [
|
|
196
|
-
| [
|
|
197
|
-
| [
|
|
198
|
-
| [
|
|
199
|
-
| [
|
|
200
|
-
| [
|
|
201
|
-
| [
|
|
202
|
-
| [
|
|
203
|
-
| [rate-limit-redis](https://github.com/routup/plugins/tree/master/packages/rate-limit-redis) | Redis adapter for the rate-limit plugin. |
|
|
204
|
-
| [swagger](https://github.com/routup/plugins/tree/master/packages/swagger) | Serve generated docs from URL or based on a JSON file. |
|
|
157
|
+
Routup is minimalistic by design. [Plugins](https://github.com/routup/plugins) extend the framework with additional functionality.
|
|
158
|
+
|
|
159
|
+
| Name | Description |
|
|
160
|
+
|------|-------------|
|
|
161
|
+
| [assets](https://github.com/routup/plugins/tree/master/packages/assets) | Serve static files from a directory |
|
|
162
|
+
| [basic](https://github.com/routup/plugins/tree/master/packages/basic) | Bundle of body, cookie, and query plugins |
|
|
163
|
+
| [body](https://github.com/routup/plugins/tree/master/packages/body) | Read and parse the request body |
|
|
164
|
+
| [cookie](https://github.com/routup/plugins/tree/master/packages/cookie) | Read and parse request cookies |
|
|
165
|
+
| [decorators](https://github.com/routup/plugins/tree/master/packages/decorators) | Class, method, and parameter decorators |
|
|
166
|
+
| [prometheus](https://github.com/routup/plugins/tree/master/packages/prometheus) | Collect and serve Prometheus metrics |
|
|
167
|
+
| [query](https://github.com/routup/plugins/tree/master/packages/query) | Parse URL query strings |
|
|
168
|
+
| [rate-limit](https://github.com/routup/plugins/tree/master/packages/rate-limit) | Rate limit incoming requests |
|
|
169
|
+
| [rate-limit-redis](https://github.com/routup/plugins/tree/master/packages/rate-limit-redis) | Redis adapter for rate-limit |
|
|
170
|
+
| [swagger](https://github.com/routup/plugins/tree/master/packages/swagger) | Serve Swagger/OpenAPI docs |
|
|
205
171
|
|
|
206
172
|
## Benchmarks
|
|
207
173
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
* Method: `autocannon -c 100 -d 40 -p 10 localhost:3000` (two rounds; one to warm-up, one to measure)
|
|
213
|
-
|
|
214
|
-
| Package | Requests/s | Latency (ms) | Throughput/MB |
|
|
215
|
-
|:-----------|:-----------:|-------------:|--------------:|
|
|
216
|
-
| http | 61062 | 15.87 | 10.89 |
|
|
217
|
-
| fastify | 59679 | 16.26 | 10.70 |
|
|
218
|
-
| koa | 45763 | 21.35 | 8.16 |
|
|
219
|
-
| **routup** | 44588 | 21.91 | 9.02 |
|
|
220
|
-
| hapi | 41374 | 23.67 | 7.38 |
|
|
221
|
-
| express | 13376 | 74.18 | 2.39 |
|
|
222
|
-
|
|
223
|
-
Benchmarks were generated using autocannon.
|
|
224
|
-
To recreate the results, this can be done using the [benchmarks'](https://github.com/routup/benchmarks) repository.
|
|
174
|
+
> **Note:** These benchmarks were recorded with routup v4 (Node.js 18, Sep 2023). Routup v5 uses srvx and Web Standard APIs — updated benchmarks will follow.
|
|
175
|
+
|
|
176
|
+
To run benchmarks yourself, see the [benchmarks](https://github.com/routup/benchmarks) repository.
|
|
177
|
+
|
|
225
178
|
## Contributing
|
|
226
179
|
|
|
227
180
|
Before starting to work on a pull request, it is important to review the guidelines for
|
package/dist/bun.cjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("./src-Ca2_b8P0.cjs");
|
|
3
|
+
let srvx_bun = require("srvx/bun");
|
|
4
|
+
//#region src/_entries/bun.ts
|
|
5
|
+
function serve(router, options) {
|
|
6
|
+
return (0, srvx_bun.serve)({
|
|
7
|
+
fetch: router.fetch.bind(router),
|
|
8
|
+
...options
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.Handler = require_src.Handler;
|
|
13
|
+
exports.HandlerSymbol = require_src.HandlerSymbol;
|
|
14
|
+
exports.HandlerType = require_src.HandlerType;
|
|
15
|
+
exports.HeaderName = require_src.HeaderName;
|
|
16
|
+
exports.MethodName = require_src.MethodName;
|
|
17
|
+
exports.PathMatcher = require_src.PathMatcher;
|
|
18
|
+
exports.Router = require_src.Router;
|
|
19
|
+
exports.RoutupError = require_src.RoutupError;
|
|
20
|
+
exports.RoutupEvent = require_src.RoutupEvent;
|
|
21
|
+
exports.appendResponseHeader = require_src.appendResponseHeader;
|
|
22
|
+
exports.appendResponseHeaderDirective = require_src.appendResponseHeaderDirective;
|
|
23
|
+
exports.coreHandler = require_src.coreHandler;
|
|
24
|
+
exports.createError = require_src.createError;
|
|
25
|
+
exports.createEventStream = require_src.createEventStream;
|
|
26
|
+
exports.errorHandler = require_src.errorHandler;
|
|
27
|
+
exports.fromNodeHandler = require_src.fromNodeHandler;
|
|
28
|
+
exports.fromNodeMiddleware = require_src.fromNodeMiddleware;
|
|
29
|
+
exports.getRequestAcceptableCharset = require_src.getRequestAcceptableCharset;
|
|
30
|
+
exports.getRequestAcceptableCharsets = require_src.getRequestAcceptableCharsets;
|
|
31
|
+
exports.getRequestAcceptableContentType = require_src.getRequestAcceptableContentType;
|
|
32
|
+
exports.getRequestAcceptableContentTypes = require_src.getRequestAcceptableContentTypes;
|
|
33
|
+
exports.getRequestAcceptableEncoding = require_src.getRequestAcceptableEncoding;
|
|
34
|
+
exports.getRequestAcceptableEncodings = require_src.getRequestAcceptableEncodings;
|
|
35
|
+
exports.getRequestAcceptableLanguage = require_src.getRequestAcceptableLanguage;
|
|
36
|
+
exports.getRequestAcceptableLanguages = require_src.getRequestAcceptableLanguages;
|
|
37
|
+
exports.getRequestHeader = require_src.getRequestHeader;
|
|
38
|
+
exports.getRequestHostName = require_src.getRequestHostName;
|
|
39
|
+
exports.getRequestIP = require_src.getRequestIP;
|
|
40
|
+
exports.getRequestProtocol = require_src.getRequestProtocol;
|
|
41
|
+
exports.isError = require_src.isError;
|
|
42
|
+
exports.isHandler = require_src.isHandler;
|
|
43
|
+
exports.isHandlerConfig = require_src.isHandlerConfig;
|
|
44
|
+
exports.isPath = require_src.isPath;
|
|
45
|
+
exports.isPlugin = require_src.isPlugin;
|
|
46
|
+
exports.isRequestCacheable = require_src.isRequestCacheable;
|
|
47
|
+
exports.isResponseGone = require_src.isResponseGone;
|
|
48
|
+
exports.matchRequestContentType = require_src.matchRequestContentType;
|
|
49
|
+
exports.readBody = require_src.readBody;
|
|
50
|
+
exports.sendAccepted = require_src.sendAccepted;
|
|
51
|
+
exports.sendCreated = require_src.sendCreated;
|
|
52
|
+
exports.sendFile = require_src.sendFile;
|
|
53
|
+
exports.sendFormat = require_src.sendFormat;
|
|
54
|
+
exports.sendRedirect = require_src.sendRedirect;
|
|
55
|
+
exports.sendStream = require_src.sendStream;
|
|
56
|
+
exports.serializeEventStreamMessage = require_src.serializeEventStreamMessage;
|
|
57
|
+
exports.serve = serve;
|
|
58
|
+
exports.setResponseCacheHeaders = require_src.setResponseCacheHeaders;
|
|
59
|
+
exports.setResponseContentTypeByFileName = require_src.setResponseContentTypeByFileName;
|
|
60
|
+
exports.setResponseGone = require_src.setResponseGone;
|
|
61
|
+
exports.setResponseHeaderAttachment = require_src.setResponseHeaderAttachment;
|
|
62
|
+
exports.setResponseHeaderContentType = require_src.setResponseHeaderContentType;
|
|
63
|
+
exports.toResponse = require_src.toResponse;
|
|
64
|
+
exports.useRequestNegotiator = require_src.useRequestNegotiator;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=bun.cjs.map
|
package/dist/bun.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun.cjs","names":[],"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;AAClF,SAAA,GAAA,SAAA,OAAiB;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
|
package/dist/bun.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $ as RouterPipelineContext, A as sendAccepted, At as HeaderName, B as createEventStream, C as sendRedirect, Ct as IDispatcher, D as SendFileStats, Dt as RoutupResponse, E as SendFileOptions, Et as RoutupRequest, F as isResponseGone, G as isError, H as EventStreamMessage, I as setResponseGone, J as isPlugin, K as createError, L as serializeEventStreamMessage, M as setResponseHeaderAttachment, N as appendResponseHeader, O as sendFile, Ot as HTTPErrorInput, P as appendResponseHeaderDirective, Q as IRouter, R as EventStreamHandle, S as sendStream, St as PathMatcherOptions, T as SendFileContentOptions, Tt as IRoutupEvent, U as ResponseCacheHeadersOptions, V as EventStreamListener, W as setResponseCacheHeaders, X as PluginInstallContext, Y as Plugin, Z as PluginInstallFn, _ as getRequestHeader, _t as HandlerType, a as getRequestIP, at as fromNodeMiddleware, b as toResponse, bt as Path, c as matchRequestContentType, ct as CoreHandlerFn, d as getRequestAcceptableEncoding, dt as HandlerFn, et as isHandler, f as getRequestAcceptableEncodings, ft as errorHandler, g as getRequestAcceptableContentTypes, gt as HandlerSymbol, h as getRequestAcceptableContentType, ht as HandlerBaseConfig, i as RequestIpOptions, it as fromNodeHandler, j as setResponseHeaderContentType, jt as MethodName, k as sendCreated, kt as RoutupError, l as getRequestAcceptableLanguage, lt as Handler, m as getRequestAcceptableCharsets, mt as ErrorHandlerFn, n as getRequestProtocol, nt as NodeHandler, o as RequestHostNameOptions, ot as coreHandler, p as getRequestAcceptableCharset, pt as ErrorHandlerConfig, q as Router, r as useRequestNegotiator, rt as NodeMiddleware, s as getRequestHostName, st as CoreHandlerConfig, t as RequestProtocolOptions, tt as isHandlerConfig, u as getRequestAcceptableLanguages, ut as HandlerConfig, v as isRequestCacheable, vt as isPath, w as sendFormat, wt as RoutupEvent, x as setResponseContentTypeByFileName, xt as PathMatcherExecResult, y as readBody, yt as PathMatcher, z as EventStreamOptions } from "./index-9K5FcIb3.cjs";
|
|
2
|
+
import { Server, ServerOptions } from "srvx";
|
|
3
|
+
|
|
4
|
+
//#region src/_entries/bun.d.ts
|
|
5
|
+
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CoreHandlerConfig, CoreHandlerFn, ErrorHandlerConfig, ErrorHandlerFn, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseConfig, HandlerConfig, HandlerFn, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
8
|
+
//# sourceMappingURL=bun.d.cts.map
|
package/dist/bun.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $ as RouterPipelineContext, A as sendAccepted, At as HeaderName, B as createEventStream, C as sendRedirect, Ct as IDispatcher, D as SendFileStats, Dt as RoutupResponse, E as SendFileOptions, Et as RoutupRequest, F as isResponseGone, G as isError, H as EventStreamMessage, I as setResponseGone, J as isPlugin, K as createError, L as serializeEventStreamMessage, M as setResponseHeaderAttachment, N as appendResponseHeader, O as sendFile, Ot as HTTPErrorInput, P as appendResponseHeaderDirective, Q as IRouter, R as EventStreamHandle, S as sendStream, St as PathMatcherOptions, T as SendFileContentOptions, Tt as IRoutupEvent, U as ResponseCacheHeadersOptions, V as EventStreamListener, W as setResponseCacheHeaders, X as PluginInstallContext, Y as Plugin, Z as PluginInstallFn, _ as getRequestHeader, _t as HandlerType, a as getRequestIP, at as fromNodeMiddleware, b as toResponse, bt as Path, c as matchRequestContentType, ct as CoreHandlerFn, d as getRequestAcceptableEncoding, dt as HandlerFn, et as isHandler, f as getRequestAcceptableEncodings, ft as errorHandler, g as getRequestAcceptableContentTypes, gt as HandlerSymbol, h as getRequestAcceptableContentType, ht as HandlerBaseConfig, i as RequestIpOptions, it as fromNodeHandler, j as setResponseHeaderContentType, jt as MethodName, k as sendCreated, kt as RoutupError, l as getRequestAcceptableLanguage, lt as Handler, m as getRequestAcceptableCharsets, mt as ErrorHandlerFn, n as getRequestProtocol, nt as NodeHandler, o as RequestHostNameOptions, ot as coreHandler, p as getRequestAcceptableCharset, pt as ErrorHandlerConfig, q as Router, r as useRequestNegotiator, rt as NodeMiddleware, s as getRequestHostName, st as CoreHandlerConfig, t as RequestProtocolOptions, tt as isHandlerConfig, u as getRequestAcceptableLanguages, ut as HandlerConfig, v as isRequestCacheable, vt as isPath, w as sendFormat, wt as RoutupEvent, x as setResponseContentTypeByFileName, xt as PathMatcherExecResult, y as readBody, yt as PathMatcher, z as EventStreamOptions } from "./index-B6F5CzQy.mjs";
|
|
2
|
+
import { Server, ServerOptions } from "srvx";
|
|
3
|
+
|
|
4
|
+
//#region src/_entries/bun.d.ts
|
|
5
|
+
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CoreHandlerConfig, CoreHandlerFn, ErrorHandlerConfig, ErrorHandlerFn, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseConfig, HandlerConfig, HandlerFn, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
8
|
+
//# sourceMappingURL=bun.d.mts.map
|
package/dist/bun.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { A as sendCreated, B as createEventStream, C as sendRedirect, D as useRequestNegotiator, E as getRequestAcceptableContentTypes, F as setResponseContentTypeByFileName, G as HandlerSymbol, H as setResponseCacheHeaders, I as appendResponseHeader, J as createError, K as HandlerType, L as appendResponseHeaderDirective, M as toResponse, N as setResponseHeaderContentType, O as getRequestHeader, P as setResponseHeaderAttachment, Q as MethodName, R as isResponseGone, S as sendStream, T as getRequestAcceptableContentType, U as isPath, V as serializeEventStreamMessage, W as PathMatcher, X as isError, Y as RoutupError, Z as HeaderName, _ as fromNodeHandler, a as getRequestHostName, b as coreHandler, c as getRequestAcceptableLanguages, d as getRequestAcceptableCharset, f as getRequestAcceptableCharsets, g as isHandlerConfig, h as isHandler, i as getRequestIP, j as sendAccepted, k as sendFile, l as getRequestAcceptableEncoding, m as readBody, n as isPlugin, o as matchRequestContentType, p as isRequestCacheable, q as RoutupEvent, r as getRequestProtocol, s as getRequestAcceptableLanguage, t as Router, u as getRequestAcceptableEncodings, v as fromNodeMiddleware, w as sendFormat, x as Handler, y as errorHandler, z as setResponseGone } from "./src-C789deGE.mjs";
|
|
2
|
+
import { serve as serve$1 } from "srvx/bun";
|
|
3
|
+
//#region src/_entries/bun.ts
|
|
4
|
+
function serve(router, options) {
|
|
5
|
+
return serve$1({
|
|
6
|
+
fetch: router.fetch.bind(router),
|
|
7
|
+
...options
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=bun.mjs.map
|
package/dist/bun.mjs.map
ADDED
|
@@ -0,0 +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;AAClF,QAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("./src-Ca2_b8P0.cjs");
|
|
3
|
+
let srvx_cloudflare = require("srvx/cloudflare");
|
|
4
|
+
//#region src/_entries/cloudflare.ts
|
|
5
|
+
function serve(router, options) {
|
|
6
|
+
return (0, srvx_cloudflare.serve)({
|
|
7
|
+
fetch: router.fetch.bind(router),
|
|
8
|
+
...options
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.Handler = require_src.Handler;
|
|
13
|
+
exports.HandlerSymbol = require_src.HandlerSymbol;
|
|
14
|
+
exports.HandlerType = require_src.HandlerType;
|
|
15
|
+
exports.HeaderName = require_src.HeaderName;
|
|
16
|
+
exports.MethodName = require_src.MethodName;
|
|
17
|
+
exports.PathMatcher = require_src.PathMatcher;
|
|
18
|
+
exports.Router = require_src.Router;
|
|
19
|
+
exports.RoutupError = require_src.RoutupError;
|
|
20
|
+
exports.RoutupEvent = require_src.RoutupEvent;
|
|
21
|
+
exports.appendResponseHeader = require_src.appendResponseHeader;
|
|
22
|
+
exports.appendResponseHeaderDirective = require_src.appendResponseHeaderDirective;
|
|
23
|
+
exports.coreHandler = require_src.coreHandler;
|
|
24
|
+
exports.createError = require_src.createError;
|
|
25
|
+
exports.createEventStream = require_src.createEventStream;
|
|
26
|
+
exports.errorHandler = require_src.errorHandler;
|
|
27
|
+
exports.fromNodeHandler = require_src.fromNodeHandler;
|
|
28
|
+
exports.fromNodeMiddleware = require_src.fromNodeMiddleware;
|
|
29
|
+
exports.getRequestAcceptableCharset = require_src.getRequestAcceptableCharset;
|
|
30
|
+
exports.getRequestAcceptableCharsets = require_src.getRequestAcceptableCharsets;
|
|
31
|
+
exports.getRequestAcceptableContentType = require_src.getRequestAcceptableContentType;
|
|
32
|
+
exports.getRequestAcceptableContentTypes = require_src.getRequestAcceptableContentTypes;
|
|
33
|
+
exports.getRequestAcceptableEncoding = require_src.getRequestAcceptableEncoding;
|
|
34
|
+
exports.getRequestAcceptableEncodings = require_src.getRequestAcceptableEncodings;
|
|
35
|
+
exports.getRequestAcceptableLanguage = require_src.getRequestAcceptableLanguage;
|
|
36
|
+
exports.getRequestAcceptableLanguages = require_src.getRequestAcceptableLanguages;
|
|
37
|
+
exports.getRequestHeader = require_src.getRequestHeader;
|
|
38
|
+
exports.getRequestHostName = require_src.getRequestHostName;
|
|
39
|
+
exports.getRequestIP = require_src.getRequestIP;
|
|
40
|
+
exports.getRequestProtocol = require_src.getRequestProtocol;
|
|
41
|
+
exports.isError = require_src.isError;
|
|
42
|
+
exports.isHandler = require_src.isHandler;
|
|
43
|
+
exports.isHandlerConfig = require_src.isHandlerConfig;
|
|
44
|
+
exports.isPath = require_src.isPath;
|
|
45
|
+
exports.isPlugin = require_src.isPlugin;
|
|
46
|
+
exports.isRequestCacheable = require_src.isRequestCacheable;
|
|
47
|
+
exports.isResponseGone = require_src.isResponseGone;
|
|
48
|
+
exports.matchRequestContentType = require_src.matchRequestContentType;
|
|
49
|
+
exports.readBody = require_src.readBody;
|
|
50
|
+
exports.sendAccepted = require_src.sendAccepted;
|
|
51
|
+
exports.sendCreated = require_src.sendCreated;
|
|
52
|
+
exports.sendFile = require_src.sendFile;
|
|
53
|
+
exports.sendFormat = require_src.sendFormat;
|
|
54
|
+
exports.sendRedirect = require_src.sendRedirect;
|
|
55
|
+
exports.sendStream = require_src.sendStream;
|
|
56
|
+
exports.serializeEventStreamMessage = require_src.serializeEventStreamMessage;
|
|
57
|
+
exports.serve = serve;
|
|
58
|
+
exports.setResponseCacheHeaders = require_src.setResponseCacheHeaders;
|
|
59
|
+
exports.setResponseContentTypeByFileName = require_src.setResponseContentTypeByFileName;
|
|
60
|
+
exports.setResponseGone = require_src.setResponseGone;
|
|
61
|
+
exports.setResponseHeaderAttachment = require_src.setResponseHeaderAttachment;
|
|
62
|
+
exports.setResponseHeaderContentType = require_src.setResponseHeaderContentType;
|
|
63
|
+
exports.toResponse = require_src.toResponse;
|
|
64
|
+
exports.useRequestNegotiator = require_src.useRequestNegotiator;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=cloudflare.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudflare.cjs","names":[],"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;AAClF,SAAA,GAAA,gBAAA,OAAiB;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $ as RouterPipelineContext, A as sendAccepted, At as HeaderName, B as createEventStream, C as sendRedirect, Ct as IDispatcher, D as SendFileStats, Dt as RoutupResponse, E as SendFileOptions, Et as RoutupRequest, F as isResponseGone, G as isError, H as EventStreamMessage, I as setResponseGone, J as isPlugin, K as createError, L as serializeEventStreamMessage, M as setResponseHeaderAttachment, N as appendResponseHeader, O as sendFile, Ot as HTTPErrorInput, P as appendResponseHeaderDirective, Q as IRouter, R as EventStreamHandle, S as sendStream, St as PathMatcherOptions, T as SendFileContentOptions, Tt as IRoutupEvent, U as ResponseCacheHeadersOptions, V as EventStreamListener, W as setResponseCacheHeaders, X as PluginInstallContext, Y as Plugin, Z as PluginInstallFn, _ as getRequestHeader, _t as HandlerType, a as getRequestIP, at as fromNodeMiddleware, b as toResponse, bt as Path, c as matchRequestContentType, ct as CoreHandlerFn, d as getRequestAcceptableEncoding, dt as HandlerFn, et as isHandler, f as getRequestAcceptableEncodings, ft as errorHandler, g as getRequestAcceptableContentTypes, gt as HandlerSymbol, h as getRequestAcceptableContentType, ht as HandlerBaseConfig, i as RequestIpOptions, it as fromNodeHandler, j as setResponseHeaderContentType, jt as MethodName, k as sendCreated, kt as RoutupError, l as getRequestAcceptableLanguage, lt as Handler, m as getRequestAcceptableCharsets, mt as ErrorHandlerFn, n as getRequestProtocol, nt as NodeHandler, o as RequestHostNameOptions, ot as coreHandler, p as getRequestAcceptableCharset, pt as ErrorHandlerConfig, q as Router, r as useRequestNegotiator, rt as NodeMiddleware, s as getRequestHostName, st as CoreHandlerConfig, t as RequestProtocolOptions, tt as isHandlerConfig, u as getRequestAcceptableLanguages, ut as HandlerConfig, v as isRequestCacheable, vt as isPath, w as sendFormat, wt as RoutupEvent, x as setResponseContentTypeByFileName, xt as PathMatcherExecResult, y as readBody, yt as PathMatcher, z as EventStreamOptions } from "./index-9K5FcIb3.cjs";
|
|
2
|
+
import { Server, ServerOptions } from "srvx";
|
|
3
|
+
|
|
4
|
+
//#region src/_entries/cloudflare.d.ts
|
|
5
|
+
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CoreHandlerConfig, CoreHandlerFn, ErrorHandlerConfig, ErrorHandlerFn, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseConfig, HandlerConfig, HandlerFn, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
8
|
+
//# sourceMappingURL=cloudflare.d.cts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $ as RouterPipelineContext, A as sendAccepted, At as HeaderName, B as createEventStream, C as sendRedirect, Ct as IDispatcher, D as SendFileStats, Dt as RoutupResponse, E as SendFileOptions, Et as RoutupRequest, F as isResponseGone, G as isError, H as EventStreamMessage, I as setResponseGone, J as isPlugin, K as createError, L as serializeEventStreamMessage, M as setResponseHeaderAttachment, N as appendResponseHeader, O as sendFile, Ot as HTTPErrorInput, P as appendResponseHeaderDirective, Q as IRouter, R as EventStreamHandle, S as sendStream, St as PathMatcherOptions, T as SendFileContentOptions, Tt as IRoutupEvent, U as ResponseCacheHeadersOptions, V as EventStreamListener, W as setResponseCacheHeaders, X as PluginInstallContext, Y as Plugin, Z as PluginInstallFn, _ as getRequestHeader, _t as HandlerType, a as getRequestIP, at as fromNodeMiddleware, b as toResponse, bt as Path, c as matchRequestContentType, ct as CoreHandlerFn, d as getRequestAcceptableEncoding, dt as HandlerFn, et as isHandler, f as getRequestAcceptableEncodings, ft as errorHandler, g as getRequestAcceptableContentTypes, gt as HandlerSymbol, h as getRequestAcceptableContentType, ht as HandlerBaseConfig, i as RequestIpOptions, it as fromNodeHandler, j as setResponseHeaderContentType, jt as MethodName, k as sendCreated, kt as RoutupError, l as getRequestAcceptableLanguage, lt as Handler, m as getRequestAcceptableCharsets, mt as ErrorHandlerFn, n as getRequestProtocol, nt as NodeHandler, o as RequestHostNameOptions, ot as coreHandler, p as getRequestAcceptableCharset, pt as ErrorHandlerConfig, q as Router, r as useRequestNegotiator, rt as NodeMiddleware, s as getRequestHostName, st as CoreHandlerConfig, t as RequestProtocolOptions, tt as isHandlerConfig, u as getRequestAcceptableLanguages, ut as HandlerConfig, v as isRequestCacheable, vt as isPath, w as sendFormat, wt as RoutupEvent, x as setResponseContentTypeByFileName, xt as PathMatcherExecResult, y as readBody, yt as PathMatcher, z as EventStreamOptions } from "./index-B6F5CzQy.mjs";
|
|
2
|
+
import { Server, ServerOptions } from "srvx";
|
|
3
|
+
|
|
4
|
+
//#region src/_entries/cloudflare.d.ts
|
|
5
|
+
declare function serve(router: Router, options?: Omit<ServerOptions, 'fetch'>): Server;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CoreHandlerConfig, CoreHandlerFn, ErrorHandlerConfig, ErrorHandlerFn, EventStreamHandle, EventStreamListener, EventStreamMessage, EventStreamOptions, HTTPErrorInput, Handler, HandlerBaseConfig, HandlerConfig, HandlerFn, HandlerSymbol, HandlerType, HeaderName, IDispatcher, IRouter, IRoutupEvent, MethodName, NodeHandler, NodeMiddleware, Path, PathMatcher, PathMatcherExecResult, PathMatcherOptions, Plugin, PluginInstallContext, PluginInstallFn, RequestHostNameOptions, RequestIpOptions, RequestProtocolOptions, ResponseCacheHeadersOptions, Router, RouterPipelineContext, RoutupError, RoutupEvent, RoutupRequest, RoutupResponse, SendFileContentOptions, SendFileOptions, SendFileStats, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
8
|
+
//# sourceMappingURL=cloudflare.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { A as sendCreated, B as createEventStream, C as sendRedirect, D as useRequestNegotiator, E as getRequestAcceptableContentTypes, F as setResponseContentTypeByFileName, G as HandlerSymbol, H as setResponseCacheHeaders, I as appendResponseHeader, J as createError, K as HandlerType, L as appendResponseHeaderDirective, M as toResponse, N as setResponseHeaderContentType, O as getRequestHeader, P as setResponseHeaderAttachment, Q as MethodName, R as isResponseGone, S as sendStream, T as getRequestAcceptableContentType, U as isPath, V as serializeEventStreamMessage, W as PathMatcher, X as isError, Y as RoutupError, Z as HeaderName, _ as fromNodeHandler, a as getRequestHostName, b as coreHandler, c as getRequestAcceptableLanguages, d as getRequestAcceptableCharset, f as getRequestAcceptableCharsets, g as isHandlerConfig, h as isHandler, i as getRequestIP, j as sendAccepted, k as sendFile, l as getRequestAcceptableEncoding, m as readBody, n as isPlugin, o as matchRequestContentType, p as isRequestCacheable, q as RoutupEvent, r as getRequestProtocol, s as getRequestAcceptableLanguage, t as Router, u as getRequestAcceptableEncodings, v as fromNodeMiddleware, w as sendFormat, x as Handler, y as errorHandler, z as setResponseGone } from "./src-C789deGE.mjs";
|
|
2
|
+
import { serve as serve$1 } from "srvx/cloudflare";
|
|
3
|
+
//#region src/_entries/cloudflare.ts
|
|
4
|
+
function serve(router, options) {
|
|
5
|
+
return serve$1({
|
|
6
|
+
fetch: router.fetch.bind(router),
|
|
7
|
+
...options
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Handler, HandlerSymbol, HandlerType, HeaderName, MethodName, PathMatcher, Router, RoutupError, RoutupEvent, appendResponseHeader, appendResponseHeaderDirective, coreHandler, createError, createEventStream, errorHandler, fromNodeHandler, fromNodeMiddleware, getRequestAcceptableCharset, getRequestAcceptableCharsets, getRequestAcceptableContentType, getRequestAcceptableContentTypes, getRequestAcceptableEncoding, getRequestAcceptableEncodings, getRequestAcceptableLanguage, getRequestAcceptableLanguages, getRequestHeader, getRequestHostName, getRequestIP, getRequestProtocol, isError, isHandler, isHandlerConfig, isPath, isPlugin, isRequestCacheable, isResponseGone, matchRequestContentType, readBody, sendAccepted, sendCreated, sendFile, sendFormat, sendRedirect, sendStream, serializeEventStreamMessage, serve, setResponseCacheHeaders, setResponseContentTypeByFileName, setResponseGone, setResponseHeaderAttachment, setResponseHeaderContentType, toResponse, useRequestNegotiator };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=cloudflare.mjs.map
|
|
@@ -0,0 +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;AAClF,QAAOA,QAAU;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
|
package/dist/deno.cjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("./src-Ca2_b8P0.cjs");
|
|
3
|
+
let srvx_deno = require("srvx/deno");
|
|
4
|
+
//#region src/_entries/deno.ts
|
|
5
|
+
function serve(router, options) {
|
|
6
|
+
return (0, srvx_deno.serve)({
|
|
7
|
+
fetch: router.fetch.bind(router),
|
|
8
|
+
...options
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.Handler = require_src.Handler;
|
|
13
|
+
exports.HandlerSymbol = require_src.HandlerSymbol;
|
|
14
|
+
exports.HandlerType = require_src.HandlerType;
|
|
15
|
+
exports.HeaderName = require_src.HeaderName;
|
|
16
|
+
exports.MethodName = require_src.MethodName;
|
|
17
|
+
exports.PathMatcher = require_src.PathMatcher;
|
|
18
|
+
exports.Router = require_src.Router;
|
|
19
|
+
exports.RoutupError = require_src.RoutupError;
|
|
20
|
+
exports.RoutupEvent = require_src.RoutupEvent;
|
|
21
|
+
exports.appendResponseHeader = require_src.appendResponseHeader;
|
|
22
|
+
exports.appendResponseHeaderDirective = require_src.appendResponseHeaderDirective;
|
|
23
|
+
exports.coreHandler = require_src.coreHandler;
|
|
24
|
+
exports.createError = require_src.createError;
|
|
25
|
+
exports.createEventStream = require_src.createEventStream;
|
|
26
|
+
exports.errorHandler = require_src.errorHandler;
|
|
27
|
+
exports.fromNodeHandler = require_src.fromNodeHandler;
|
|
28
|
+
exports.fromNodeMiddleware = require_src.fromNodeMiddleware;
|
|
29
|
+
exports.getRequestAcceptableCharset = require_src.getRequestAcceptableCharset;
|
|
30
|
+
exports.getRequestAcceptableCharsets = require_src.getRequestAcceptableCharsets;
|
|
31
|
+
exports.getRequestAcceptableContentType = require_src.getRequestAcceptableContentType;
|
|
32
|
+
exports.getRequestAcceptableContentTypes = require_src.getRequestAcceptableContentTypes;
|
|
33
|
+
exports.getRequestAcceptableEncoding = require_src.getRequestAcceptableEncoding;
|
|
34
|
+
exports.getRequestAcceptableEncodings = require_src.getRequestAcceptableEncodings;
|
|
35
|
+
exports.getRequestAcceptableLanguage = require_src.getRequestAcceptableLanguage;
|
|
36
|
+
exports.getRequestAcceptableLanguages = require_src.getRequestAcceptableLanguages;
|
|
37
|
+
exports.getRequestHeader = require_src.getRequestHeader;
|
|
38
|
+
exports.getRequestHostName = require_src.getRequestHostName;
|
|
39
|
+
exports.getRequestIP = require_src.getRequestIP;
|
|
40
|
+
exports.getRequestProtocol = require_src.getRequestProtocol;
|
|
41
|
+
exports.isError = require_src.isError;
|
|
42
|
+
exports.isHandler = require_src.isHandler;
|
|
43
|
+
exports.isHandlerConfig = require_src.isHandlerConfig;
|
|
44
|
+
exports.isPath = require_src.isPath;
|
|
45
|
+
exports.isPlugin = require_src.isPlugin;
|
|
46
|
+
exports.isRequestCacheable = require_src.isRequestCacheable;
|
|
47
|
+
exports.isResponseGone = require_src.isResponseGone;
|
|
48
|
+
exports.matchRequestContentType = require_src.matchRequestContentType;
|
|
49
|
+
exports.readBody = require_src.readBody;
|
|
50
|
+
exports.sendAccepted = require_src.sendAccepted;
|
|
51
|
+
exports.sendCreated = require_src.sendCreated;
|
|
52
|
+
exports.sendFile = require_src.sendFile;
|
|
53
|
+
exports.sendFormat = require_src.sendFormat;
|
|
54
|
+
exports.sendRedirect = require_src.sendRedirect;
|
|
55
|
+
exports.sendStream = require_src.sendStream;
|
|
56
|
+
exports.serializeEventStreamMessage = require_src.serializeEventStreamMessage;
|
|
57
|
+
exports.serve = serve;
|
|
58
|
+
exports.setResponseCacheHeaders = require_src.setResponseCacheHeaders;
|
|
59
|
+
exports.setResponseContentTypeByFileName = require_src.setResponseContentTypeByFileName;
|
|
60
|
+
exports.setResponseGone = require_src.setResponseGone;
|
|
61
|
+
exports.setResponseHeaderAttachment = require_src.setResponseHeaderAttachment;
|
|
62
|
+
exports.setResponseHeaderContentType = require_src.setResponseHeaderContentType;
|
|
63
|
+
exports.toResponse = require_src.toResponse;
|
|
64
|
+
exports.useRequestNegotiator = require_src.useRequestNegotiator;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=deno.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.cjs","names":[],"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;AAClF,SAAA,GAAA,UAAA,OAAiB;EAAE,OAAO,OAAO,MAAM,KAAK,OAAO;EAAE,GAAG;EAAS,CAAC"}
|