UNPKG

@kth/cortina-block

Version:

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

32 lines (31 loc) 724 B
import type { Response } from 'express'; export type Config = { blockApiUrl: string; blocksConfig?: BlocksConfig; redisConfig?: RedisConfig; redisKey?: string; skipCookieScriptsInDev?: boolean; supportedLanguages?: SupportedLang[]; memoryCache?: boolean; }; export type RedisConfig = { host: string; port: number; }; export type BlocksConfig = { [blockName: string]: string; }; export type BlocksObject = { [blockName: string]: string; }; export type SupportedLang = 'sv' | 'en'; export type ExtendedResponse = Response & { locals?: { locale: { language: SupportedLang; }; blocks?: { [key: string]: string; }; }; };