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

264
Vistas
Problem with mime type while rendering html file from node.js

I am using node.js webserver. I am also socket.io and webrtc for getting audio streaming in my application. I am rendering a html file from here using a path /audio as shown here.

const webServer = http.createServer(app);

const socketIo = require("socket.io")(webServer); // web socket external module

app.use( '/assets', express.static( path.join( __dirname, 'assets' ) ) );

// Rendering html file
app.get( '/audio', ( req, res ) => {

res.sendFile( __dirname + '/index.html' );
} );

The html file contains CSS and js files an I am loading them as below.

<link rel="stylesheet" href='assets/css/app.css' type="text/css">
<script type="module" src='./assets/js/rtc.js'></script>
<script type="module" src='./assets/js/events.js'></script>
<script type="module" src='./assets/js/autolink.js'></script>

When I am running this html file through /audio, I am unable to load these CSS and JS files. In the console I am getting this mime type error.

Console errors

I have tried all the solutions that I have got through web. But nothing worked as of now.

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