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

418
Views
Why does 'app' go as a parameter for module.exports?

In my routes file, I export all code and import it at my index.js. What's the purpose of inserting 'app' as a parameter in my export statement?

module.exports = (app) => {

Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What you are looking is a Arrow Function that accepts one argument.

This module is exporting a default function which can be imported like this

var test = require('./whatever-file');

and now test is a function.

test('a string argument')

Obviously with the little that is posted we can't infer what type app is supposed to be. So, you will need to adjust according to whatever is needed.

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