- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
44 lines
853 B
JavaScript
44 lines
853 B
JavaScript
/*!
|
|
* express
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|
* Copyright(c) 2013 Roman Shtylman
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
* MIT Licensed
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Module dependencies.
|
|
* @private
|
|
*/
|
|
|
|
var setPrototypeOf = require('setprototypeof')
|
|
|
|
/**
|
|
* Initialization middleware, exposing the
|
|
* request and response to each other, as well
|
|
* as defaulting the X-Powered-By header field.
|
|
*
|
|
* @param {Function} app
|
|
* @return {Function}
|
|
* @api private
|
|
*/
|
|
|
|
exports.init = function(app){
|
|
return function expressInit(req, res, next){
|
|
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
|
|
req.res = res;
|
|
res.req = req;
|
|
req.next = next;
|
|
|
|
setPrototypeOf(req, app.request)
|
|
setPrototypeOf(res, app.response)
|
|
|
|
res.locals = res.locals || Object.create(null);
|
|
|
|
next();
|
|
};
|
|
};
|
|
|