refactor: add commented titles to each file
This commit is contained in:
@@ -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
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
// securityMw.js
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const fetch = require('node-fetch');
|
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) => {
|
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.
|
||||||
|
Reference in New Issue
Block a user