Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
NodeJS Shortener Code Don't Work at Chromium

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!