From 7402fb503e64b1a1b39b8a6d040d3f0d24a97ed7 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Fri, 11 Jan 2019 21:24:20 -0500 Subject: [PATCH] Fixed issue with static content server for the projects pages. --- includes/staticContentServer.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/includes/staticContentServer.js b/includes/staticContentServer.js index ea5ec07..bd2e417 100644 --- a/includes/staticContentServer.js +++ b/includes/staticContentServer.js @@ -13,46 +13,47 @@ module.exports= serveStaticContent: function(request, result, filename, baseURL) { + fullPath = baseURL + filename; if (filename.includes(".svg") || filename.includes(".svg")) { - includes.sendSVG(result, baseURL + filename); + includes.sendSVG(result, fullPath); return true; } //handles image requests else if (filename.includes(".jpg") || filename.includes(".png") || filename.includes(".ico")) { - includes.sendImage(result, baseURL + filename); + includes.sendImage(result, fullPath); return true; } //css and font files else if (filename.includes(".woff2") || filename.includes(".css") || filename.includes(".txt")) { - includes.sendCSS(result, baseURL + filename); + includes.sendCSS(result, fullPath); return true; } else if (filename.includes(".json")) { - if(filename.includes("includes/") || filename.includes("blogContent")) + if(fullPath.includes("includes/") || fullPath.includes("blogContent")) { - includes.sendHTML(result, baseURL + filename); + includes.sendHTML(result, fullPath); return true; } } //scripts else if (filename.includes(".js")) { - if(filename.includes("includes/") || filename.includes("blogContent")) + if(fullPath.includes("includes/") || fullPath.includes("blogContent")) { - includes.sendJS(result, baseURL + filename); + includes.sendJS(result, fullPath); return true; } } //html else if (filename.includes(".html")) { - includes.sendHTML(result, baseURL + filename); + includes.sendHTML(result, fullPath); return true; } return false;