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

207
Vistas
Unable to access file on local http-server from javascript fs

I'm trying to access the directory listing of files from the http-server webserver listing configured on the localhost:4040.

I have uploaded files using the http-server to mimic a file server for testing. When I use fs to access the files in the folder with the full URL (e.g. http://localhost:4040/folder1/), I get the following error:-

Error: ENOENT: no such file or directory, scandir 'http://localhost:4040/folder1/'

The directory listing is accessible if I browse the same URL through the web browser.

fs
.readdirSync(imagePath)
.forEach((filename, index) => {
   console.log(filename
   files.push({path: imagePath, fileName: filename, fullFileName: imagePath + '/' + filename})
          });
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