UNPKG

@tsed/platform-express

Version:
16 lines (15 loc) 362 B
import Express from "express"; /** * @ignore */ export function staticsMiddleware(directory, options = {}) { const middleware = Express.static(directory, options); return (request, response, next) => { if (!response.headersSent) { middleware(request, response, next); } else { next(); } }; }