From f8874b33b96d082ca9ae5523f271e0ebf6427e51 Mon Sep 17 00:00:00 2001 From: tulioperdigao <116309232+tulioperdigao@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:56:38 -0300 Subject: [PATCH] =?UTF-8?q?FEAT:=20Adiciona=20bot=C3=A3o=20de=20download?= =?UTF-8?q?=20para=20o=20modelo=20do=20CSV.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 9 ++++++++- models/modelo.viabilidade.csv | 1 + public/index.html | 1 + public/main.js | 9 +++++++++ public/style.css | 7 +++++++ 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 models/modelo.viabilidade.csv diff --git a/app.js b/app.js index 894d164..ffd6d19 100644 --- a/app.js +++ b/app.js @@ -422,7 +422,14 @@ app.get("/", (req, res) => { return res.json({ jobId }); }); - // download endpoint + // download model endpoint + app.get("/download-model", (req, res) => { + const modelPath = path.join(__dirname, "models", "modelo.viabilidade.csv"); + if (!fs.existsSync(modelPath)) return res.status(404).send("Modelo não encontrado"); + return res.download(modelPath, "modelo.viabilidade.csv"); + }); + + // download result endpoint app.get("/download/:name", (req, res) => { const name = req.params.name; const p = path.join(__dirname, "outputs", name); diff --git a/models/modelo.viabilidade.csv b/models/modelo.viabilidade.csv new file mode 100644 index 0000000..f5c90ae --- /dev/null +++ b/models/modelo.viabilidade.csv @@ -0,0 +1 @@ +CEP;Numero diff --git a/public/index.html b/public/index.html index 97604ff..417ffbd 100644 --- a/public/index.html +++ b/public/index.html @@ -44,6 +44,7 @@ +