@buntal/http 0.0.10 → 0.0.11
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/index.ts +5 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WebSocketHandler } from 'bun'
|
|
1
|
+
import type { ServeFunctionOptions, WebSocketHandler } from 'bun'
|
|
2
2
|
import { Req, Res } from './app'
|
|
3
3
|
import { h, type AtomicHandler } from './handler'
|
|
4
4
|
import type { ALLOWED_METHODS } from './lib/const'
|
|
@@ -13,6 +13,7 @@ type Config = {
|
|
|
13
13
|
match: Bun.MatchedRoute
|
|
14
14
|
handler: any
|
|
15
15
|
}) => Promise<Response | void>
|
|
16
|
+
options?: Partial<ServeFunctionOptions<any, any>>
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
type ExtractRouteParams<Path extends string> =
|
|
@@ -44,6 +45,7 @@ export class Http {
|
|
|
44
45
|
const middlewares = this.middlewares
|
|
45
46
|
|
|
46
47
|
const server = Bun.serve({
|
|
48
|
+
...this.config.options as any,
|
|
47
49
|
port: this.config.port,
|
|
48
50
|
reusePort: true,
|
|
49
51
|
routes: this.routes,
|
|
@@ -183,5 +185,6 @@ export class Http {
|
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
export * from './app'
|
|
186
|
-
export * from './router'
|
|
187
188
|
export * from './handler'
|
|
189
|
+
export * from './router'
|
|
190
|
+
|