Skip to content

Type Alias: HTTPServiceEntrypointOptions ​

HTTPServiceEntrypointOptions = InterfaceListeningOptions & object

The options of httpServiceEntrypoint; with interface, it listens on network interfaces instead of an address (see InterfaceListeningOptions).

Type Declaration ​

host? ​

optional host?: string

The host or address the server listens on; excludes interface.

Default ​

ts
all the interfaces

limit? ​

optional limit?: number

The largest request body, in bytes; a larger one is answered with 413 and an error response.

Default ​

ts
10485760 (10 MiB)

listening? ​

optional listening?: (server, listeners?) => void | Promise<void>

Run once the server listens, with the server (to read the port picked for port 0); with interface, once the listeners of the interfaces are made, with them too (the server itself does not listen then: its address() is null, the listeners give the port and the addresses). A failure fails the entrypoint start.

Parameters ​

server ​

Server

listeners? ​

IInterfaceListener[]

Returns ​

void | Promise<void>

middlewares? ​

optional middlewares?: MiddlewareDefinition[]

The middlewares of this adapter's actions, run after the entrypoint's global middlewares.

name? ​

optional name?: string

The adapter name, to tell apart several service adapters of one entrypoint.

path? ​

optional path?: string

The path receiving the requests (POST). The event stream is served on events under it (/api → /api/events).

Default ​

ts
'/'

port? ​

optional port?: number

The port the server listens on; 0 picks a random free port. The entrypoint fails to start when the port is in use.

Default ​

ts
3000

Released under the MIT License.