Route RPC back-end API requests to the appropriate functions with context about authentication, the request itself and more.

Usage

import * from "@resistdesign/voltra/api";

Example

export const handler = async (event: any): Promise<CloudFunctionResponse> =>
handleCloudFunctionEvent(
event,
AWS.normalizeCloudFunctionEvent,
addRoutesToRouteMap({}, [
{
path: "",
authConfig: {
anyAuthorized: true,
},
handler: async () => 'WELCOME!!!!',
}
]),
[
process.env.CLIENT_ORIGIN as string,
/https:\\/\\/example\\.com(:.*?$|\\/.*$|$)/gim,
]
);

Index

Namespaces