UNPKG

@fontoxml/fontoxml-development-tools

Version:

Development tools for Fonto.

28 lines (22 loc) 791 B
import correlationIdRepository from './correlationIdRepository.js'; import AnnotationRepository from './review-annotations/AnnotationRepository.js'; import DevelopmentCms from './stores/DevelopmentCms.js'; import ProfileRepository from './profiles/ProfileRepository.js'; /** @typedef {import('../../src/getAppConfig.js').DevCmsConfig} DevCmsConfig */ /** * @param {DevCmsConfig} config */ export default function (config) { const annotationRepository = new AnnotationRepository(config); const cms = new DevelopmentCms(config); const profileRepository = new ProfileRepository(); return (req, _res, next) => { req.cms = cms; req.repositories = { annotation: annotationRepository, correlationId: correlationIdRepository, profile: profileRepository, }; next(); }; }