I want to make shorter my code. In this case I maked this
const s_html = 'text/html';
const s_png = 'image/png';
const s_jpg = 'image/jpg';
const s_jpeg = 'image/jpeg';
const s_css = 'text/css';
const s_js = 'text/javascript';
My Shortener Function
function datatype(file, filetype) {
fs.readFile(file, function(err,data){res.writeHead(200, {'Content-Type': filetype}); res.write(data); res.end();})
}
After, I allowed to make this
case '/static/toolkit.js':
datatype("./static/toolkit.js", "s_js");
break;
After run my code, My website don't show style but css code is available in Inspect>Source
There is no wrong or missing something. Later on I connect my website on Firefox and it was seamless.
So what's the problem there? Is it problem in my browser? Because I use ungoogled chromium in debian