From d01d4ef40a7aaf7d1002b5214ab68c94810ec637 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:12:41 +0700 Subject: [PATCH] feat: use middleware --- src/app.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.ts b/src/app.ts index 2d500f5..d9c0a8f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -5,6 +5,7 @@ import swaggerUi from "swagger-ui-express"; import swaggerDocument from "./swagger.json"; import error from "./middlewares/error"; import { RegisterRoutes } from "./routes"; +import logMiddleware from "./middlewares/log"; const APP_HOST = process.env.APP_HOST || "0.0.0.0"; const APP_PORT = +(process.env.APP_PORT || 3000); @@ -15,6 +16,9 @@ const APP_PORT = +(process.env.APP_PORT || 3000); app.use(cors()); app.use(json()); app.use(urlencoded({ extended: true })); + + app.use(logMiddleware); + app.use("/", express.static("static")); app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument));