Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda