UNPKG

@kth/cortina-block

Version:

Node.js module for fetching Cortina blocks and optionally cache using Redis.

15 lines (14 loc) 564 B
import { NextFunction, Request } from 'express'; import { Config, SupportedLang, BlocksConfig, Redis, ExtendedResponse } from './types'; export * from './types'; export declare function cortina(options: { blockApiUrl: string; language: SupportedLang; shouldSkipCookieScripts: boolean; blocksConfig?: BlocksConfig; redisClient?: Redis; redisKey?: string; }): Promise<{ [blockName: string]: string; }>; export declare function cortinaMiddleware(config: Config): (req: Request, res: ExtendedResponse, next: NextFunction) => Promise<void>;