import type { Container } from '@chubbyts/chubbyts-dic-types/dist/container';import { createContainer } from '@chubbyts/chubbyts-dic/dist/container';import type { Middleware } from '@chubbyts/chubbyts-http-types/dist/middleware';import type { Logger } from 'some-logger/dist/logger';import { createLazyMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/lazy-middleware';const container: Container = createContainer();container.set('middlewareServiceId', (container: Container): Middleware => { return createMyMiddleware(container.get<Logger>('logger'));});const middleware: Middleware = createLazyMiddleware(container, 'middlewareServiceId'); Copy
import type { Container } from '@chubbyts/chubbyts-dic-types/dist/container';import { createContainer } from '@chubbyts/chubbyts-dic/dist/container';import type { Middleware } from '@chubbyts/chubbyts-http-types/dist/middleware';import type { Logger } from 'some-logger/dist/logger';import { createLazyMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/lazy-middleware';const container: Container = createContainer();container.set('middlewareServiceId', (container: Container): Middleware => { return createMyMiddleware(container.get<Logger>('logger'));});const middleware: Middleware = createLazyMiddleware(container, 'middlewareServiceId');