From e921875bded06a520534dece4b1804cd64fdf97f Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Sun, 5 Jan 2025 22:03:03 +0700 Subject: [PATCH] edit build --- Dockerfile | 2 +- libs/docx-templates-lib.ts | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c298f0..edc9501 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,6 @@ COPY templates templates COPY package.json . ENV NODE_ENV production RUN npm install -COPY dist2 . +COPY dist . EXPOSE 80 CMD ["node","app.js"] diff --git a/libs/docx-templates-lib.ts b/libs/docx-templates-lib.ts index cc266d9..128a289 100644 --- a/libs/docx-templates-lib.ts +++ b/libs/docx-templates-lib.ts @@ -149,8 +149,6 @@ docxTemplateRoute.post("/", async function (req, res) { if (!req.headers["content-type"] || !req.headers["accept"]) throw new Error("Require header content-type, accept") let inputType = mimeToExtension(req.headers["content-type"]) let outputMediaType = mimeToExtension(req.headers["accept"]) - console.log("content-type: ", inputType) - console.log("accept: ", outputMediaType) let template = null // Save the converted file to disk if (req.query["folder"]) { @@ -224,13 +222,11 @@ docxTemplateRoute.post("/upload", async function (req, res) { res.statusCode = 400 res.statusMessage = "Require header: content-type(application/octet-stream) accept" res.end(res.statusMessage) - console.log(req.headers["content-type"], req.headers["accept"], req.query["report_name"]) return } // Determine the output media type and report name from headers let outputMediaType = mimeToExtension(req.headers["accept"]) let reportName = req.query["report_name"] - console.log("convert output: " + outputMediaType) // Save the converted file to disk if (req.query["folder"]) { @@ -297,8 +293,6 @@ docxTemplateRoute.post("/download", async function (req, res) { if (!req.headers["content-type"] || !req.headers["accept"] || !req.body.template) throw new Error("Require header content-type, accept") let inputType = mimeToExtension(req.headers["content-type"]) let outputMediaType = mimeToExtension(req.headers["accept"]) - console.log("content-type: ", inputType) - console.log("accept: ", outputMediaType) let buffer = null if (req.query["folder"]) { buffer = await fs.promises.readFile(`./${TEMPLATE_FOLDER_NAME}/${req.query["folder"]}/${req.body.template}.docx`)