Browse Source

Fixed issue with static content server for the projects pages.

pull/39/head
jrtechs 6 years ago
parent
commit
7402fb503e
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      includes/staticContentServer.js

+ 9
- 8
includes/staticContentServer.js View File

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

Loading…
Cancel
Save