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 @@ +