diff --git a/dental-server/public/index.html b/dental-server/public/index.html index a67a720..0212ec5 100644 --- a/dental-server/public/index.html +++ b/dental-server/public/index.html @@ -49,6 +49,9 @@ Dispositivos / Sync + + Baixar Cliente (.exe) + Plugins / Wasabi diff --git a/dental-server/server.js b/dental-server/server.js index 2ded4f2..1ef0aad 100644 --- a/dental-server/server.js +++ b/dental-server/server.js @@ -587,6 +587,23 @@ app.use('/updates', express.static(path.join(__dirname, 'updates'), { } })); +// Rota para baixar o instalador do cliente diretamente pelo painel +app.get('/download-client', async (req, res) => { + try { + const updatesDir = path.join(__dirname, 'updates'); + const files = await fs.readdir(updatesDir); + const exeFile = files.find(f => f.endsWith('.exe')); + + if (exeFile) { + res.download(path.join(updatesDir, exeFile), 'ScoreOdonto-Cliente-Setup.exe'); + } else { + res.status(404).send('Instalador do cliente ainda não disponível para download.'); + } + } catch (error) { + res.status(500).send('Erro ao buscar o instalador do cliente.'); + } +}); + // ================================================================ // SOCKET.IO - CONEXÕES EM TEMPO REAL // ================================================================