refactor: add commented titles to each file

This commit is contained in:
2025-08-21 18:59:43 -05:00
parent 01d7bccfe1
commit 40f3f101d7
4 changed files with 5 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
// contactController.js
module.exports = (pool, transporter) => { module.exports = (pool, transporter) => {
// The main function that handles the form submission // The main function that handles the form submission

View File

@@ -1,3 +1,4 @@
// securityMw.js
require('dotenv').config(); require('dotenv').config();
const fetch = require('node-fetch'); const fetch = require('node-fetch');

View File

@@ -1,4 +1,4 @@
// The entire module is now a function that accepts 'contactController' and security middleware as an argument. // contactRoutes.js
module.exports = (contactController, securityMw) => { module.exports = (contactController, securityMw) => {
const express = require('express'); const express = require('express');
const router = express.Router(); const router = express.Router();
@@ -13,7 +13,7 @@ module.exports = (contactController, securityMw) => {
}); });
// Define the route for form submissions with all middleware // Define the route for form submissions with all middleware
router.post('/', router.post('/submit-form',
apiLimiter, apiLimiter,
// The security middleware is now a separate step, // The security middleware is now a separate step,
// containing both the honeypot check and hCaptcha verification. // containing both the honeypot check and hCaptcha verification.

View File

@@ -1,3 +1,4 @@
//server.js
const nodemailer = require('nodemailer'); const nodemailer = require('nodemailer');
const express = require('express'); const express = require('express');
const path = require('path'); const path = require('path');