import {Request, Response} from 'express'; import {NextFunction} from 'express-serve-static-core'; import {Application} from '../index'; export default function init(app: Application): (req: Request, res: Response, next: NextFunction) => void { return (req: Request, res: Response, next: NextFunction) => { req.mitamaApp = app; res.mitamaApp = app; req.workspace = app.workspace; res.workspace = app.workspace; next(); } }