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

100
Vistas
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 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