|
@ -13,46 +13,47 @@ module.exports= |
|
|
|
|
|
|
|
|
serveStaticContent: function(request, result, filename, baseURL) |
|
|
serveStaticContent: function(request, result, filename, baseURL) |
|
|
{ |
|
|
{ |
|
|
|
|
|
fullPath = baseURL + filename; |
|
|
if (filename.includes(".svg") || filename.includes(".svg")) |
|
|
if (filename.includes(".svg") || filename.includes(".svg")) |
|
|
{ |
|
|
{ |
|
|
includes.sendSVG(result, baseURL + filename); |
|
|
|
|
|
|
|
|
includes.sendSVG(result, fullPath); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
//handles image requests
|
|
|
//handles image requests
|
|
|
else if (filename.includes(".jpg") || |
|
|
else if (filename.includes(".jpg") || |
|
|
filename.includes(".png") || filename.includes(".ico")) |
|
|
filename.includes(".png") || filename.includes(".ico")) |
|
|
{ |
|
|
{ |
|
|
includes.sendImage(result, baseURL + filename); |
|
|
|
|
|
|
|
|
includes.sendImage(result, fullPath); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
//css and font files
|
|
|
//css and font files
|
|
|
else if (filename.includes(".woff2") || filename.includes(".css") || |
|
|
else if (filename.includes(".woff2") || filename.includes(".css") || |
|
|
filename.includes(".txt")) |
|
|
filename.includes(".txt")) |
|
|
{ |
|
|
{ |
|
|
includes.sendCSS(result, baseURL + filename); |
|
|
|
|
|
|
|
|
includes.sendCSS(result, fullPath); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
else if (filename.includes(".json")) |
|
|
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; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//scripts
|
|
|
//scripts
|
|
|
else if (filename.includes(".js")) |
|
|
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; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//html
|
|
|
//html
|
|
|
else if (filename.includes(".html")) |
|
|
else if (filename.includes(".html")) |
|
|
{ |
|
|
{ |
|
|
includes.sendHTML(result, baseURL + filename); |
|
|
|
|
|
|
|
|
includes.sendHTML(result, fullPath); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|