protectApi(client:MonoCloudBackendNodeClient,options?:ProtectApiRequestOptions<Request<ParamsDictionary,any,any,ParsedQs,Record<string,any>>>):ProtectMiddleware
Creates an Express middleware factory for protecting API routes using a pre-configured client.
| Parameter | Type | Description |
|---|---|---|
client | MonoCloudBackendNodeClient | A pre-configured MonoCloudBackendNodeClient instance. |
options? | ProtectApiRequestOptions<Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>> | Options for extracting tokens and certificates from the request. |
protectApi(options?:ProtectApiRequestOptions<Request<ParamsDictionary,any,any,ParsedQs,Record<string,any>>>):ProtectMiddleware
Creates an Express middleware factory for protecting API routes.
A new MonoCloudBackendNodeClient is created from the provided options, or from environment variables.
| Parameter | Type | Description |
|---|---|---|
options? | ProtectApiRequestOptions<Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>> | Options for extracting tokens and certificates from the request. |