Sign in

Function: protectApi

Call Signature

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.

Parameters

ParameterTypeDescription
clientMonoCloudBackendNodeClientA pre-configured MonoCloudBackendNodeClient instance.
options?ProtectApiRequestOptions<Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>>Options for extracting tokens and certificates from the request.

Call Signature

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.

Parameters

ParameterTypeDescription
options?ProtectApiRequestOptions<Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>>Options for extracting tokens and certificates from the request.
© 2024 MonoCloud. All rights reserved.