Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
how to trigger a function inside another function using HTTP get request?

I have the socketController function and I wanted to call it inside the summation function so that every time I did the GET of the summation func, the socketcontroller function would be triggered. Is it possible to do this? The sum func console.log is giving UNDEFINED

controller.js

module.exports = {
      async socketController(client) {
        return client.send('mandando algo pro cliente');
      },
    
      async somatoria(request, response, socketController) {
        console.log(socketController);
        return response.json(socketController);
      }
}

server.js

  const interval = setInterval(() => {
    socketController(client);
    clearInterval(interval);
  });

console.log return:

[Function: next]

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!