File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,17 +19,18 @@ import bodyParser from "body-parser";
1919import stripeRoutes from "./src/routes/stripe.routes" ;
2020import RegistroRoutes from './src/routes/registro.routes' ;
2121import VisitasRoutes from './src/routes/visita.routes' ;
22+ import { logHandler } from "./src/middlewares/log.middleware" ;
2223
2324const app = express ( ) ;
2425
2526app . use ( cors ( ) ) ;
26-
2727app . use ( '/api/stripe/webhook' , bodyParser . raw ( { type : 'application/json' } ) ) ;
2828
2929app . use ( express . json ( ) ) ;
3030
3131setupSwagger ( app ) ;
3232
33+ app . use ( logHandler ) ;
3334app . use ( "/categoria" , categoriaRoutes ) ;
3435app . use ( "/denuncia" , denunciaRoutes ) ;
3536app . use ( "/user" , userRoutes ) ;
Original file line number Diff line number Diff line change 1+ import { NextFunction , Request , Response } from "express" ;
2+ import logger from "../../logger-winston" ;
3+
4+ export const logHandler = ( req :Request , res :Response , next :NextFunction ) => {
5+ logger . info ( `Entrando na Rota de ${ req . originalUrl } ` , { method :req . method , path :req . path } )
6+ next ( ) ;
7+ }
You can’t perform that action at this time.
0 commit comments