温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/Serve/UnixServeOptions
点击访问原文链接

interface UnixServeOptions | Bun module | Bun

interface UnixServeOptions | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/Serve/UnixServeOptionsPdevelopmentPerrorPidPmaxRequestBodySizePtlsPunix

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/Serve/UnixServeOptionsPdevelopmentPerrorPidPmaxRequestBodySizePtlsPunix

interface

Serve.UnixServeOptionsinterface UnixServeOptionsWebSocketData>development?: Development

Render contextual errors? This enables bun's error page

error?: (this: ServerWebSocketData>, error: ErrorLike) => void | Promisevoid> | Response | PromiseResponse>

Callback called when an error is thrown during request handling

error: (error) => {
return new Response("Internal Server Error", { status: 500 });
}
id?: null | string

Uniquely identify a server instance with an ID

When bun is started with the --hot flag:

This string will be used to hot reload the server without interrupting pending requests or websockets. If not provided, a value will be generated. To disable hot reloading, set this value to null.

When bun is not started with the --hot flag:

This string will currently do nothing. But in the future it could be useful for logs or metrics.

maxRequestBodySize?: number

What is the maximum size of a request body? (in bytes)

tls?: TLSOptions | TLSOptions[]

Set options for using TLS with this server

const server = Bun.serve({
fetch: request => new Response("Welcome to Bun!"),
tls: {
cert: Bun.file("cert.pem"),
key: Bun.file("key.pem"),
ca: [Bun.file("ca1.pem"), Bun.file("ca2.pem")],
},
});
unix?: string

If set, the HTTP server will listen on a unix socket instead of a port. (Cannot be used with hostname+port)

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

interface UnixServeOptions | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for interface bun.Serve.UnixServeOptions | Bun