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.