|
|
@ -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; |
|
|
|