first commit

This commit is contained in:
2026-04-11 14:08:27 +07:00
parent e86e5d2c46
commit 6b7655aa16
389 changed files with 5387 additions and 60861 deletions

View File

@@ -2,617 +2,58 @@ const express = require("express");
const router = express.Router();
const { ensureAuthenticated } = require("../middleware/auth");
const dashboardController = require("../controllers/dashboardController");
const uploadController = require("../controllers/uploadController");
const homeController = require("../controllers/homeController");
const headerController = require("../controllers/headerController");
const footerController = require("../controllers/footerController");
const aboutUsController = require("../controllers/aboutUsController");
const formController = require("../controllers/formController");
const contactController = require("../controllers/contactController");
const pageController = require("../controllers/pageController");
const settingController = require("../controllers/settingController");
const faqController = require("../controllers/faqController"); // Thêm import này
const termsController = require("../controllers/termsController");
const travelController = require("../controllers/travelController");
const visaController = require("../controllers/visaController");
const { upload, uploadVideo, convertToWebp } = require("../middleware/upload");
const safetyController = require("../controllers/safetyController");
const insuranceController = require("../controllers/insuranceController");
const qualificationController = require("../controllers/qualificationController");
const certificateController = require("../controllers/certificateController");
const departmentController = require("../controllers/departmentController");
const levelController = require("../controllers/levelController");
const auditLogController = require("../controllers/auditLogController");
const activityController = require("../controllers/activityController");
const bookingSubmissionController = require("../controllers/bookingSubmissionController");
const serviceController = require("../controllers/serviceController");
const headerMenuController = require("../controllers/headerMenuController");
// Blog controllers
const blogController = require("../controllers/blogController");
const blogCategoryController = require("../controllers/blogCategoryController");
const blogTagController = require("../controllers/blogTagController");
const socialLinkController = require("../controllers/socialLinkController");
const testimonialController = require("../controllers/testimonialController");
const videoGalleryController = require("../controllers/videoGalleryController");
const { uploadDegree } = require("../middleware/upload");
// Dashboard
router.get("/dashboard", ensureAuthenticated, dashboardController.getDashboard);
// Home
router.get("/home", ensureAuthenticated, homeController.index);
router.post("/home/update", ensureAuthenticated, homeController.update);
router.get("/home/api/blogs", ensureAuthenticated, homeController.apiGetBlogs);
// Qualification routes
router.get("/qualification", ensureAuthenticated, qualificationController.index);
router.get("/qualification/create", ensureAuthenticated, qualificationController.createForm);
router.post("/qualification/create", ensureAuthenticated, uploadDegree, qualificationController.create);
router.get("/qualification/:id/edit", ensureAuthenticated, qualificationController.editForm);
router.post("/qualification/:id/edit", ensureAuthenticated, uploadDegree, qualificationController.update);
router.post("/qualification/:id/delete", ensureAuthenticated, qualificationController.destroy);
// Middleware chuẩn hóa code
router.param("code", (req, res, next, code) => {
req.params.code = code.toUpperCase();
next();
});
// Certificate routes
router.get("/certificate", ensureAuthenticated, certificateController.index);
router.get("/certificate/create", ensureAuthenticated, certificateController.createForm);
router.post("/certificate/create", ensureAuthenticated, uploadDegree, certificateController.create);
router.get("/certificate/:id/edit", ensureAuthenticated, certificateController.editForm);
router.post("/certificate/:id/edit", ensureAuthenticated, uploadDegree, certificateController.update);
router.post("/certificate/:id/delete", ensureAuthenticated, certificateController.destroy);
// About Us
router.get("/about-us", ensureAuthenticated, aboutUsController.index);
router.post("/about-us/update", ensureAuthenticated, aboutUsController.update);
// Department routes
router.get("/department", ensureAuthenticated, departmentController.index);
router.post("/department/create", ensureAuthenticated, departmentController.create);
router.post("/department/:id/edit", ensureAuthenticated, departmentController.update);
router.post("/department/:id/delete", ensureAuthenticated, departmentController.destroy);
// Booking admin CRUD removed
// Form Management
router.get("/form", ensureAuthenticated, formController.index);
router.post(
"/form/update",
ensureAuthenticated,
formController.updateDefaultForm,
);
// Upload routes
router.get("/upload", ensureAuthenticated, (req, res) => {
res.render("admin/upload/index", {
layout: "layouts/admin",
title: "Quản lý Upload Ảnh",
user: req.session.user,
});
});
router.post(
"/upload/image",
ensureAuthenticated,
upload.single("image"),
uploadController.uploadImage,
);
router.post(
"/upload/video",
ensureAuthenticated,
uploadVideo.single("video"),
uploadController.uploadVideo,
);
router.post(
"/upload/update-path",
ensureAuthenticated,
uploadController.updateImagePath,
);
router.post(
"/upload/delete",
ensureAuthenticated,
uploadController.deleteImage,
);
// Header routes
router.get("/header", ensureAuthenticated, headerController.index);
router.post("/header/update", ensureAuthenticated, headerController.update);
router.get("/header/data", ensureAuthenticated, headerController.api); // Normalized from getHeaderData
router.patch(
"/header/:id/status",
ensureAuthenticated,
headerController.updateStatus,
);
router.delete("/header/:id", ensureAuthenticated, headerController.destroy);
// Header Menu INTEGRATED routes
router.post(
"/header/menu/create",
ensureAuthenticated,
headerMenuController.store,
);
router.post(
"/header/menu/update/:id",
ensureAuthenticated,
headerMenuController.update,
);
router.post(
"/header/menu/delete",
ensureAuthenticated,
headerMenuController.destroy,
);
router.post(
"/header/menu/reorder",
ensureAuthenticated,
headerMenuController.reorder,
);
// Social Links routes
router.get("/social-links", ensureAuthenticated, socialLinkController.index);
router.post("/social-links", ensureAuthenticated, socialLinkController.store);
router.put(
"/social-links/:platform",
ensureAuthenticated,
socialLinkController.update,
);
router.delete(
"/social-links/:platform",
ensureAuthenticated,
socialLinkController.destroy,
);
router.post(
"/social-links/reorder",
ensureAuthenticated,
socialLinkController.reorder,
);
// Footer routes
router.get("/footer", ensureAuthenticated, footerController.index);
router.post("/footer/update", ensureAuthenticated, footerController.update);
router.get("/footer/data", ensureAuthenticated, footerController.getFooterData);
// Contact routes
router.get("/contact", ensureAuthenticated, contactController.index);
router.post("/contact/update", ensureAuthenticated, contactController.update);
router.get(
"/contact/data",
ensureAuthenticated,
contactController.getContactData,
);
// Contact submissions management
router.get(
"/contact/submissions",
ensureAuthenticated,
contactController.getSubmissions,
);
router.put(
"/contact/submissions/:id",
ensureAuthenticated,
contactController.updateSubmissionStatus,
);
// Appointment management
const appointmentController = require("../controllers/appointmentController");
router.get(
"/appointments",
ensureAuthenticated,
appointmentController.getAppointments,
);
router.get(
"/appointments/:id",
ensureAuthenticated,
appointmentController.getAppointmentById,
);
router.put(
"/appointments/:id",
ensureAuthenticated,
appointmentController.updateAppointmentStatus,
);
router.delete(
"/appointments/:id",
ensureAuthenticated,
appointmentController.deleteAppointment,
);
// Appointment CMS page management
router.get("/appointment", ensureAuthenticated, appointmentController.index);
router.post(
"/appointment/update",
ensureAuthenticated,
appointmentController.update,
);
router.get(
"/appointment/data",
ensureAuthenticated,
appointmentController.getAppointmentData,
);
// Pricing CMS page management
const pricingController = require("../controllers/pricingController");
router.get("/pricing", ensureAuthenticated, pricingController.index);
router.post("/pricing/update", ensureAuthenticated, pricingController.update);
router.get(
"/pricing/data",
ensureAuthenticated,
pricingController.getPricingData,
);
// Activity CRUD routes
router.get("/activity", ensureAuthenticated, activityController.index);
router.get(
"/activity/create",
ensureAuthenticated,
activityController.createForm,
);
router.post("/activity/create", ensureAuthenticated, activityController.create);
// Update filters (place before any parameterized /activity/:id routes to avoid route collision)
router.post(
"/activity/filters/update",
ensureAuthenticated,
activityController.updateFilters,
);
// Update hero (global hero section for activities)
router.post(
"/activity/hero/update",
ensureAuthenticated,
activityController.updateHero,
);
router.get(
"/activity/:id/edit",
ensureAuthenticated,
activityController.editForm,
);
router.post(
"/activity/:id/update",
ensureAuthenticated,
activityController.update,
);
router.post(
"/activity/:id/delete",
ensureAuthenticated,
activityController.delete,
);
router.post(
"/activity/:id/toggle-status",
ensureAuthenticated,
activityController.toggleStatus,
);
// Update display order
router.post(
"/activity/update-order",
ensureAuthenticated,
activityController.updateOrder,
);
// Booking submissions routes
router.get(
"/activity/:id/bookings/count",
ensureAuthenticated,
activityController.getBookingCount,
);
router.get(
"/activity/:id/bookings",
ensureAuthenticated,
activityController.getBookingSubmissions,
);
router.get(
"/activity/:id/bookings/export",
ensureAuthenticated,
activityController.exportBookingData,
);
// Export all bookings (across all activities)
router.get(
"/bookings/export-all",
ensureAuthenticated,
activityController.exportAllBookingsData,
);
// Update booking submission
router.put(
"/bookings/:bookingId",
ensureAuthenticated,
bookingSubmissionController.updateBookingSubmission,
);
// Delete booking submission
router.delete(
"/bookings/:bookingId",
ensureAuthenticated,
bookingSubmissionController.deleteBookingSubmission,
);
// Update filters
// Preview activity
router.get(
"/activity/:id/preview",
ensureAuthenticated,
activityController.preview,
);
// FAQ routes
router.get("/home/faq", ensureAuthenticated, faqController.index);
router.post("/home/faq/update", ensureAuthenticated, faqController.update);
router.get("/home/faq/data", ensureAuthenticated, faqController.getFAQData);
router.get("/home/faq/api", faqController.api);
// Deprecated FAQ API routes removed
// API routes cho quản lý FAQ items (AJAX calls)
router.post("/faq/api/add-faq", ensureAuthenticated, faqController.addFAQ);
router.put(
"/faq/api/update-faq-item/:sectionId/:faqId",
ensureAuthenticated,
faqController.updateFAQItem,
);
router.delete(
"/faq/api/delete-faq-item/:sectionId/:faqId",
ensureAuthenticated,
faqController.deleteFAQItem,
);
router.get("/terms-conditions", ensureAuthenticated, termsController.index);
router.post("/terms/update", ensureAuthenticated, termsController.update);
router.get("/terms/data", ensureAuthenticated, termsController.getTermsData);
router.get("/terms/api", termsController.api);
router.get("/terms/seed", ensureAuthenticated, termsController.seed);
// Travel routes
router.get("/travel", ensureAuthenticated, travelController.index);
router.post("/travel/update", ensureAuthenticated, travelController.update);
router.post("/travel/preview", ensureAuthenticated, travelController.preview);
router.get("/travel/data", ensureAuthenticated, travelController.getTravelData);
router.get("/travel/api", travelController.api);
router.get("/travel/seed", ensureAuthenticated, travelController.seed);
// Deprecated FAQ API routes removed
// API routes cho quản lý FAQ sections (AJAX calls)
router.post(
"/faq/api/add-section",
ensureAuthenticated,
faqController.addFAQSection,
);
router.put(
"/faq/api/update-section/:sectionId",
ensureAuthenticated,
faqController.updateFAQSection,
);
router.delete(
"/faq/api/delete-section/:sectionId",
ensureAuthenticated,
faqController.deleteFAQSection,
);
router.post(
"/faq/api/reorder-sections",
ensureAuthenticated,
faqController.reorderFAQSection,
);
// API routes cho sidebar navigation (AJAX calls)
router.put(
"/faq/api/update-sidebar",
ensureAuthenticated,
faqController.updateSidebarNav,
);
// Safety routes
router.get("/safety", ensureAuthenticated, safetyController.index);
router.post("/safety/update", ensureAuthenticated, safetyController.update);
//Insurance routes
router.get("/insurance", ensureAuthenticated, insuranceController.index);
router.post(
"/insurance/update",
ensureAuthenticated,
insuranceController.update,
);
// Service routes
router.get("/service", ensureAuthenticated, serviceController.index);
router.post("/service/update", ensureAuthenticated, serviceController.update);
router.post(
"/service/generate-slug",
ensureAuthenticated,
serviceController.generateSlug,
);
router.get("/service/:slug/edit", ensureAuthenticated, serviceController.edit);
router.post(
"/service/:slug/edit",
ensureAuthenticated,
serviceController.updateService,
);
router.get(
"/service/:slug/details",
ensureAuthenticated,
serviceController.details,
);
router.post(
"/service/:slug/details/update",
ensureAuthenticated,
serviceController.updateDetails,
);
// Test Image Paths route
router.get("/test-images", ensureAuthenticated, (req, res) => {
const fs = require("fs");
const path = require("path");
const campLocationData = require("../data/camp-location.json");
// Collect all image paths
const imagePaths = [];
// Camps images
if (campLocationData.camps) {
campLocationData.camps.forEach((camp) => {
if (camp.image) {
imagePaths.push({
type: "Camp",
name: camp.title,
path: camp.image,
exists: fs.existsSync(path.join(__dirname, "../public", camp.image)),
});
}
});
}
// Locations images
if (campLocationData.locations) {
campLocationData.locations.forEach((location) => {
if (location.imageSrc) {
imagePaths.push({
type: "Location",
name: location.title,
path: location.imageSrc,
exists: fs.existsSync(
path.join(__dirname, "../public", location.imageSrc),
),
});
}
// Program images
if (location.programOptions) {
location.programOptions.forEach((program) => {
if (program.imageSrc) {
imagePaths.push({
type: "Program",
name: program.title,
path: program.imageSrc,
exists: fs.existsSync(
path.join(__dirname, "../public", program.imageSrc),
),
});
}
});
}
});
}
res.render("admin/test-images", {
layout: "layouts/admin",
title: "Test Image Paths",
images: imagePaths,
user: req.session.user,
});
});
// Display visa management page
router.get("/visa", ensureAuthenticated, visaController.index);
// Get country data for editing
router.get("/visa/edit/:id", ensureAuthenticated, visaController.getCountry);
// Update hero title
router.post("/visa/update", ensureAuthenticated, visaController.updateCountry);
// Add new country
router.post("/visa/add", ensureAuthenticated, visaController.addCountry);
// Update single country
router.put(
"/visa/update/:id",
ensureAuthenticated,
visaController.updateCountry,
);
// Delete country
router.delete(
"/visa/delete/:id",
ensureAuthenticated,
visaController.deleteCountry,
);
// Blog routes
// Blog Management Routes
router.get("/blog", ensureAuthenticated, blogController.index);
router.get("/blog/create", ensureAuthenticated, blogController.create);
router.post("/blog/create", ensureAuthenticated, blogController.store);
router.get("/blog/:id/edit", ensureAuthenticated, blogController.edit);
router.post("/blog/:id/edit", ensureAuthenticated, blogController.update);
router.post("/blog/:id/delete", ensureAuthenticated, blogController.destroy);
// Comment management routes
router.post(
"/blog/:blogId/comments/:commentId/approve",
ensureAuthenticated,
blogController.approveComment,
);
router.post(
"/blog/:blogId/comments/:commentId/reject",
ensureAuthenticated,
blogController.rejectComment,
);
router.post(
"/blog/:blogId/comments/:commentId/delete",
ensureAuthenticated,
blogController.deleteComment,
);
// Blog Categories Management
router.get(
"/blog/categories",
ensureAuthenticated,
blogCategoryController.index,
);
router.get(
"/blog/categories/create",
ensureAuthenticated,
blogCategoryController.create,
);
router.post(
"/blog/categories/create",
ensureAuthenticated,
blogCategoryController.store,
);
router.get(
"/blog/categories/:id/edit",
ensureAuthenticated,
blogCategoryController.edit,
);
router.post(
"/blog/categories/:id/edit",
ensureAuthenticated,
blogCategoryController.update,
);
router.post(
"/blog/categories/:id/delete",
ensureAuthenticated,
blogCategoryController.destroy,
);
router.post(
"/blog/categories/quick-create",
ensureAuthenticated,
blogCategoryController.quickCreate,
);
// Blog Tags Management
router.get("/blog/tags", ensureAuthenticated, blogTagController.index);
router.get("/blog/tags/create", ensureAuthenticated, blogTagController.create);
router.post("/blog/tags/create", ensureAuthenticated, blogTagController.store);
router.get("/blog/tags/:id/edit", ensureAuthenticated, blogTagController.edit);
router.post(
"/blog/tags/:id/edit",
ensureAuthenticated,
blogTagController.update,
);
router.post(
"/blog/tags/:id/delete",
ensureAuthenticated,
blogTagController.destroy,
);
router.post(
"/blog/tags/quick-create",
ensureAuthenticated,
blogTagController.quickCreate,
);
// Testimonials management
router.get(
"/home/testimonials",
ensureAuthenticated,
testimonialController.index,
);
router.post(
"/home/testimonials/update",
ensureAuthenticated,
testimonialController.update,
);
// Video Gallery management
router.get(
"/home/video-gallery",
ensureAuthenticated,
videoGalleryController.index,
);
router.post(
"/home/video-gallery/update",
ensureAuthenticated,
videoGalleryController.update,
);
// Level routes
router.get("/level", ensureAuthenticated, levelController.index);
router.post("/level/create", ensureAuthenticated, levelController.create);
router.post("/level/:id/edit", ensureAuthenticated, levelController.update);
router.post("/level/:id/delete", ensureAuthenticated, levelController.destroy);
// Audit Log routes
router.get("/audit-logs", ensureAuthenticated, auditLogController.index);
router.get("/audit-logs/:id", ensureAuthenticated, auditLogController.show);
router.get("/audit-logs-api", ensureAuthenticated, auditLogController.api);
router.post(
"/audit-logs/cleanup",
ensureAuthenticated,
auditLogController.cleanup,
);
router.post("/audit-logs/cleanup", ensureAuthenticated, auditLogController.cleanup);
// Protected file preview for admin (session-authenticated)
const path = require('path');
const fs = require('fs');
router.get("/files/:filename", ensureAuthenticated, (req, res) => {
const filename = path.basename(req.params.filename);
const filePath = path.join(__dirname, '../private/uploads/degree', filename);
if (!fs.existsSync(filePath)) return res.status(404).send('File not found');
res.sendFile(filePath);
});
module.exports = router;

View File

@@ -1,195 +1,13 @@
const express = require("express");
const path = require("path");
const router = express.Router();
const homeController = require("../controllers/homeController");
const aboutUsController = require("../controllers/aboutUsController");
const headerController = require("../controllers/headerController");
const socialLinkController = require("../controllers/socialLinkController");
const footerController = require("../controllers/footerController");
const contactController = require("../controllers/contactController");
const faqController = require("../controllers/faqController");
const visaController = require("../controllers/visaController");
const headerMenuController = require("../controllers/headerMenuController");
const safetyController = require("../controllers/safetyController");
// Booking flow removed
const qualificationController = require("../controllers/qualificationController");
const certificateController = require("../controllers/certificateController");
const { validateApiKey } = require("../middleware/apiKey");
const insuranceController = require("../controllers/insuranceController");
const termsController = require("../controllers/termsController"); // <-- IMPORT ĐÃ CÓ
const activityController = require("../controllers/activityController");
const travelController = require("../controllers/travelController");
const bookingSubmissionController = require("../controllers/bookingSubmissionController");
// Public API — spec: GET /api/verify-degree/{degree_id}?api_key={API_KEY}
router.get("/api/verify-degree/:degree_id", validateApiKey, qualificationController.apiVerify);
const serviceController = require("../controllers/serviceController");
// Blog controllers
const blogController = require("../controllers/blogController");
const blogCategoryController = require("../controllers/blogCategoryController");
const blogTagController = require("../controllers/blogTagController");
// Trang chủ
router.get("/", (req, res) => {
res.render("index", {
title: "Welcome",
layout: "layouts/main",
});
});
// API để lấy dữ liệu trang chủ
router.get("/api/home", homeController.api);
// API để lấy dữ liệu about
router.get("/api/about", aboutUsController.getAbout);
router.put("/api/about", aboutUsController.updateAbout);
// Public about-us page and API (legacy support)
router.get("/about-us", aboutUsController.getAbout);
router.get("/api/about-us", aboutUsController.getAbout);
// Header API route
router.get("/api/header", headerController.api);
// Menu Tree API route (for frontend)
router.get("/api/menu-tree", headerController.getMenuTreeAPI);
// Header Menu New Module API
router.get("/api/header-menu", headerMenuController.api);
// Social Links API routes
router.get("/api/social-links", socialLinkController.index);
router.get("/api/social-links/:platform", socialLinkController.show);
// Footer API routes
router.get("/api/footer", footerController.getFooter);
router.put("/api/admin/footer", footerController.updateFooter);
// Contact API route
router.get("/api/contact", contactController.api);
// Contact form submission (public)
router.post("/api/contact/submit", contactController.submitForm);
// Appointment API
const appointmentController = require("../controllers/appointmentController");
router.get("/api/appointment", appointmentController.api);
router.post("/api/appointment/submit", appointmentController.submitAppointment);
// Pricing API
const pricingController = require("../controllers/pricingController");
router.get("/api/pricing", pricingController.api);
router.get("/api/faq", faqController.api);
// Safety API route
router.get("/api/safety", safetyController.api);
// Activity API routes
router.get("/api/activities", activityController.api);
router.get("/api/activities/:id", activityController.apiDetail);
// Insurance APi route
router.get("/api/insurance", insuranceController.api);
router.get("/api/terms", termsController.api);
// Travel public page and API
router.get("/travel", async (req, res) => {
try {
const Travel = require("../models/travel");
const travel = await Travel.findOne();
if (!travel) {
return res.status(404).render("errors/404", {
title: "Page Not Found",
message: "Travel information not found",
});
}
res.render("page/travel", {
title: travel.page.title,
data: travel.toObject(),
});
} catch (error) {
console.error("Error loading travel page:", error);
res.status(500).render("errors/500", {
title: "Server Error",
message: "Error loading travel page",
});
}
});
router.get("/api/travel", travelController.api);
// Booking submission APIs (public endpoints)
router.post("/api/booking/submit", bookingSubmissionController.submitBooking);
router.get("/api/activity/:activityId/sessions", bookingSubmissionController.getAvailableSessions);
router.get(
"/api/activity/:activityId/session/:sessionId/availability",
bookingSubmissionController.getSessionAvailability,
);
// Demo booking form
router.get("/demo/booking-form", (req, res) => {
res.sendFile(path.join(__dirname, "../views/demo/booking-form.html"));
});
// Demo session booking API
router.get("/demo/session-booking-api", (req, res) => {
res.sendFile(path.join(__dirname, "../views/demo/session-booking-api.html"));
});
// Blog API Routes
router.get("/api/blog", blogController.api);
router.get("/api/blog/featured", blogController.apiFeatured);
router.get("/api/blog/recent", blogController.apiRecent);
// Blog Categories API (must come before /api/blog/:slug)
router.get("/api/blog/categories", blogCategoryController.api);
router.get("/api/blog/categories/:slug", blogCategoryController.apiShow);
// Blog Tags API (must come before /api/blog/:slug)
router.get("/api/blog/tags", blogTagController.api);
router.get("/api/blog/tags/popular", blogTagController.apiPopular);
router.get("/api/blog/tags/:slug", blogTagController.apiShow);
// Blog post specific APIs (must come before /api/blog/:slug)
router.get("/api/blog/:id/categories", blogController.apiCategories);
router.get("/api/blog/:id/tags", blogController.apiTags);
// Blog comments (must come before /api/blog/:slug)
router.post("/api/blog/:slug/comments", blogController.apiCreateComment);
// Blog detail by slug (must come last among blog routes)
router.get("/api/blog/:slug", blogController.apiShow);
// // API route cho blog detail
// router.get('/api/blog-detail', blogDetailController.api);
/* CMS - Hailearning
*/
// service
router.get("/service", serviceController.index);
router.post("/service", serviceController.update);
router.get("/api/service", serviceController.api);
// Service details by slug
router.get("/api/service/:slug", serviceController.getServiceBySlug);
// Service slugs list
router.get("/api/service-slugs", serviceController.getServiceSlugs);
router.get("/api/visa", visaController.api);
router.get("/api/visa/country", visaController.apiCountries);
// Testimonials API
const testimonialController = require("../controllers/testimonialController");
router.get("/api/testimonials", testimonialController.api);
// Video Gallery API
const videoGalleryController = require("../controllers/videoGalleryController");
router.get("/api/video-gallery", videoGalleryController.api);
// Test route for footer
router.get("/test-footer", (req, res) => {
res.render("test-footer", {
title: "Footer Test",
layout: "layouts/main",
});
});
// Public API — spec: GET /api/verify-certificate/{cert_id}?api_key={API_KEY}
router.get("/api/verify-certificate/:cert_id", validateApiKey, certificateController.apiVerify);
module.exports = router;