Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
how to send data on file with sendFile in express

I am trying to parse my csv file in server and return back the information after parsing and analyzing the data in csv.

I am not that used to express and i dont know any view engine.

I plan to use

res.sendFile(path.join(__dirname, "/index.html"));

to host my index file.

What are the other way than ajax and view template that can I send data to the index.html with sendFile.

I am sending JSON files from server to client

Any kind of help is appreciated !!!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When a client (such as a browser) makes a request you can respond with one thing.

You can respond with:

  • The contents of a file as you are now (although you should use the static middleware instead of rolling your own end point handlers (without caching) one-by-one)
  • A template + some data rendered into a single file (using the view engines you haven't gotten around to learning yet)
  • Some JSON (typically in response to an Ajax request so the a JS program running in an HTML document get add more data to the existing HTML page)
  • Something else

If sending an unmodified file is not what you want, then don't use sendFile.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda