initLRPC( config: { app: Express; application: string; authorize?: ( token: string, path: string, role: string[], ) => Promise<{ data: any; message: string; status: Status }>; corsConfig?: { allowedHeaders?: string | string[]; credentials?: boolean; exposedHeaders?: string | string[]; maxAge?: number; methods?: string | string[]; origin?: string | boolean | RegExp | (
string | boolean | RegExp)
[]; }; isGateway?: boolean; oauthAuthorize?: ( request: Request, path: string, decoded: any, ) => Promise<{ message: string; status: Status }>; service: string; }, controllers?: any, serviceClients?: any, Container?: any, socketConfig?: { onConnection: (socketServer: any, socketClient: any) => Promise<void>; onDisconnection: ( socketServer: any, socketClient: any, data: any, ) => Promise<void>; },): LRPCEngine Parameters
- config: {
app: Express;
application: string;
authorize?: (
token: string,
path: string,
role: string[],
) => Promise<{ data: any; message: string; status: Status }>;
corsConfig?: {
allowedHeaders?: string | string[];
credentials?: boolean;
exposedHeaders?: string | string[];
maxAge?: number;
methods?: string | string[];
origin?: string | boolean | RegExp | (string | boolean | RegExp)[];
};
isGateway?: boolean;
oauthAuthorize?: (
request: Request,
path: string,
decoded: any,
) => Promise<{ message: string; status: Status }>;
service: string;
}app: Express
application: string
Optional
authorize?: (
token: string,
path: string,
role: string[],
) => Promise<{ data: any; message: string; status: Status }>
Optional
corsConfig?: {
allowedHeaders?: string | string[];
credentials?: boolean;
exposedHeaders?: string | string[];
maxAge?: number;
methods?: string | string[];
origin?: string | boolean | RegExp | (string | boolean | RegExp)[];
}
Optional
isGateway?: boolean
Optional
oauthAuthorize?: (
request: Request,
path: string,
decoded: any,
) => Promise<{ message: string; status: Status }>
service: string
Optional
controllers: anyOptional
serviceClients: anyOptional
Container: anyOptional
socketConfig: {
onConnection: (socketServer: any, socketClient: any) => Promise<void>;
onDisconnection: (
socketServer: any,
socketClient: any,
data: any,
) => Promise<void>;
}
The LRPCEngine instance
This function is used to initialize the LRPC engine