refactor: add commented titles to each file
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// contactController.js
|
||||
module.exports = (pool, transporter) => {
|
||||
|
||||
// The main function that handles the form submission
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// securityMw.js
|
||||
require('dotenv').config();
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
|
@@ -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) => {
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
@@ -13,7 +13,7 @@ module.exports = (contactController, securityMw) => {
|
||||
});
|
||||
|
||||
// Define the route for form submissions with all middleware
|
||||
router.post('/',
|
||||
router.post('/submit-form',
|
||||
apiLimiter,
|
||||
// The security middleware is now a separate step,
|
||||
// containing both the honeypot check and hCaptcha verification.
|
||||
|
Reference in New Issue
Block a user