change || to ??

This commit is contained in:
2026-04-11 19:15:01 +07:00
parent ac40097bdd
commit fab72e86a6
12 changed files with 23 additions and 28 deletions

View File

@@ -192,12 +192,7 @@ exports.api = async (req, res) => {
try {
let data = await getHomeData();
const baseUrl =
process.env.BACKEND_URL || `${req.protocol}://${req.get("host")}`;
console.log("[homeController.api] BACKEND_URL=", process.env.BACKEND_URL);
console.log("[homeController.api] BACKEND_URL raw:", JSON.stringify(process.env.BACKEND_URL));
console.log("[homeController.api] BACKEND_URL truthy:", !!process.env.BACKEND_URL);
console.log("[homeController.api] resolved baseUrl=", baseUrl);
process.env.BACKEND_URL ?? `${req.protocol}://${req.get("host")}`;
// === Xử lý Blog Preview động ===
const blogPreview = data.blogPreview || {};