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?
optionalhost?:string
The host or address the server listens on; excludes interface.
Default
all the interfaceslimit?
optionallimit?:number
The largest request body, in bytes; a larger one is answered with 413 and an error response.
Default
10485760 (10 MiB)listening?
optionallistening?: (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?
Returns
void | Promise<void>
middlewares?
optionalmiddlewares?:MiddlewareDefinition[]
The middlewares of this adapter's actions, run after the entrypoint's global middlewares.
name?
optionalname?:string
The adapter name, to tell apart several service adapters of one entrypoint.
path?
optionalpath?:string
The path receiving the requests (POST). The event stream is served on events under it (/api → /api/events).
Default
'/'port?
optionalport?: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
3000