Optional authenticate?: ((authentication: Authentication, apiContext: ApiContext) => boolean | Promise<boolean>)Method to take in authentication data and return whether the user is allowed. It may be async, and is passed the endpoint's context, so it can add to it (who's calling, say). The authentication is read and put on the context whether or not this is defined.
Optional defaultDefault Authentication metadata (as in, if {type: "bearer", token: ""} is provided, estuary-rpc-server will attempt to extract a bearer token from all requests, and only allow requests to complete if that token results in the authenticate method passes, or unless the metadata specifically assigns authentication for a given endpoint to null)
Optional mapOptional maxLargest request body read, in bytes; a larger one is refused with 413
10 MiB
Optional middlewares?: Middleware<Meta>[]Midlewares to execute while executing all endpoints, using a complet ApiContext and Metadata definition
Optional port?: numberPort number for createApiServer to listen on; without one, it doesn't listen (the caller does)
Optional restMiddlewares to execute before executing REST endpoints, using only data available in the IncomingMessage
Optional server?: ServerAn existing server (an https one, say) to serve the API on, rather than a new http one
Optional staticSee StaticFileOpts for usage around serving staticfiles in common patterns
Generated using TypeDoc
Options passed to createApiServer for running your server
Params
Meta The custom Metadata type