Maximum size, in bytes, of incoming request bodies. Requests over this size are rejected with
HTTP 413. Forwarded to Fastify's bodyLimit. Default matches Fastify's default.
Max time, in milliseconds, the server will wait between TCP connect and the first request
byte. Slowloris and idle-connection attackers consume socket slots without this. Forwarded to
Fastify's connectionTimeout.
The host name that the server should listen to. Defaults to 'localhost' (loopback only) so
accidentally exposing a dev server is not the default. Set to '0.0.0.0' for containers
(Docker, k8s) that need the server reachable on all interfaces.
Max time, in milliseconds, between keep-alive requests. Forwarded to Fastify's
keepAliveTimeout.
Prevent automatically choosing an available port if the provided port is already in use. This
will cause runApi to simply crash if the given port is in use.
The port that the service should listen to requests on. Note that if lockPort is not set,
runApi will try to find the first available port starting with this given port property
(so the actual server may be listening to a different port).
If this property is set to false, no port will be listened to (so you can manually do that
later if you wish).
If set to true, a multi-threaded service (workerCount > 1) will not automatically respawn
its workers. This has no effect on single-threaded services (workerCount == 1).
Max time, in milliseconds, between the start of a request and when the response is sent. 0
disables the timeout. Forwarded to Fastify's requestTimeout.
OptionaltrustProxy?: string | number | boolean | string[] | nullTrust proxy headers (X-Forwarded-For, X-Forwarded-Proto, etc.). Required when running
behind a reverse proxy / load balancer / CDN so request.ip reflects the actual client.
Forwarded to Fastify's trustProxy.
true: trust headers from any hop.false: trust nothing (default).Maximum size, in bytes, of an inbound WebSocket message frame. Larger payloads close the
connection with 1009 (message too big). Passed through to @fastify/websocket's
options.maxPayload.
The number of workers to split the server into (for parallel request handling).
runApiOptionsShape for option explanations.
Combines user defined options with default options to create a full options type for
startApiServer.