feat: adiciona nova funcionalidade (com erro oculto) #7

Merged
pm merged 39 commits from teste-bloqueio into main 2026-06-12 23:26:15 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit cd5785c497 - Show all commits
+2 -2
View File
@@ -33,6 +33,7 @@ const transporter = nodemailer.createTransport({
} }
}); });
// Endpoint do Formulário de Contacto (Com Recetor Dinâmico) // Endpoint do Formulário de Contacto (Com Recetor Dinâmico)
app.post('/api/contact', async (req, res) => { app.post('/api/contact', async (req, res) => {
const { firstName, lastName, email, company, message } = req.body; const { firstName, lastName, email, company, message } = req.body;
@@ -84,11 +85,10 @@ app.post('/api/contact', async (req, res) => {
res.status(500).json({ error: 'Internal server error. Could not send confirmation email.' }); res.status(500).json({ error: 'Internal server error. Could not send confirmation email.' });
} }
}); });
module.exports = { app, transporter };
// Export the app for testing, but only listen if run directly // Export the app for testing, but only listen if run directly
if (require.main === module) { if (require.main === module) {
app.listen(PORT, () => { app.listen(PORT, () => {
console.log(`[Apex Server] Running on port ${PORT}`); console.log(`[Apex Server] Running on port ${PORT}`);
}); });
} }
module.exports = app;
+1 -1
View File
@@ -1,5 +1,5 @@
const request = require('supertest'); const request = require('supertest');
const app = require('../backend/server');// Adjust the path if server.js is in another folder const { app, transporter } = require('../backend/server');
const nodemailer = require('nodemailer'); const nodemailer = require('nodemailer');
// ========================================== // ==========================================