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

96
Visualizações
I am trying to send back data to the client. But the data that is console.logged in my client does not show the JSON data

When I console.log the data, I get ƒ json() { [native code] }.

This is my client-side code:

            async function getthetime() {
                const thetime = await fetch('getActivity');
                const json = await thetime.json
                console.log(json);
            }

I set a get request to the api endpoint, took the incoming data and turned it into json, and console.logged that.

This is a snippet of my serverside code:

  app.get('/getActivity', async (req, res) => { 
         var task = {"task":getTask(data,time)};
         res.send(task);
  }

When I simply console.log(task), I get exactly what I want in the terminal. For some reason I am unable to properly send that as a response.

about 4 years ago · Juan Pablo Isaza
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