UNPKG

utquidem

Version:

The meta-framework suite designed from scratch for frontend-focused modern web development.

13 lines (11 loc) 336 B
import { hook } from '@modern-js/runtime/server'; import { Request, Response, NextFunction } from 'express'; export default hook(({ addMiddleware }) => { addMiddleware(async (req: Request, res: Response, next: NextFunction) => { if (req.path === '/bff-api/foo') { res.end('foo'); } else { next(); } }); });