Interface ServeOptions

Hierarchy

  • ServeOptions

Properties

baseURI?: string

What URI should be used to make Request.url absolute?

By default, looks at hostname, port, and whether or not SSL is enabled to generate one

Example

"http://my-app.com"

Example

"https://wongmjane.com/"

This should be the public, absolute URL – include the protocol and hostname. If the port isn't 80 or 443, then include the port too.

Example

"http://localhost:3000"
development?: boolean

Render contextual errors? This enables bun's error page

Default

process.env.NODE_ENV !== 'production'

error?: ((this: Server, request: Errorlike) => Response | Promise<Response> | Promise<undefined>)

Type declaration

    • (this: Server, request: Errorlike): Response | Promise<Response> | Promise<undefined>
    • Parameters

      Returns Response | Promise<Response> | Promise<undefined>

hostname?: string

What hostname should the server listen on?

Default

"0.0.0.0" // listen on all interfaces

Example

"127.0.0.1" // Only listen locally

Example

"remix.run" // Only listen on remix.run

note: hostname should not include a {@link port}

maxRequestBodySize?: number

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

Default

1024 * 1024 * 128 // 128MB

port?: string | number

What port should the server listen on?

Default

process.env.PORT || "3000"

Methods

  • Handle HTTP requests

    Respond to Request objects with a Response object.

    Parameters

    • this: Server
    • request: Request

    Returns Response | Promise<Response>

  • Handle HTTP requests

    Respond to Request objects with a Response object.

    Parameters

    • this: Server
    • request: Request

    Returns Response | Promise<Response>

Generated using TypeDoc