UNPKG

alapa

Version:

A cutting-edge web development framework designed to revolutionize the way developers build modern web applications.

15 lines (14 loc) 474 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ServerContextMiddleware = void 0; const names_1 = require("../../core/routes/names"); const ServerContextMiddleware = (req, res, next) => { res.locals.context = { req, res, }; req.getRoute = (name, ...param) => (0, names_1.getRouteByName)(name, ...param); req.getUrl = req.getRoute; next(); }; exports.ServerContextMiddleware = ServerContextMiddleware;