title: Express Route calling methods at initialization phase?
body: <p>I have a basic express app, where app.ts looks like</p>
  <pre><code>import * as express from &quot;express&quot;;
  const application: express.Application = express();
   
  application.get(&quot;/&quot;, function(
    request: express.Request,
    response: express.Response
  ) {
    console.log(&quot;Inside Router &quot;);
    response.json({ &quot;test&quot;: true});
  }); 
  
  application.listen(3000, function() {
    console.log(&quot;sever ready&quot;);
  });
  
  </code></pre>
  <p>In this case, the console message &quot;Inside Route&quot; is printed in server console when the route is hit.</p>
  <p>However,</p>
  <p>wrapper.ts</p>
  <pre><code>
  const methods = () =&gt; {
  
  };
  
  console.log(&quot;This is a testable offence&quot;);
  export const wrapperMethod = {methods};
  
  </code></pre>
  <pre><code> const express = require('express');
  const wrapper = require('./wrapper');
  const application = express();
  
  
  application.get(&quot;/city&quot;, function(
    request,
    response
  ) {
    console.log(&quot;when&quot;);
    let results = {};
    let test = wrapper.methods();
    response.json(results);
  }); 
  
  application.listen(3000, function() {
    console.log(&quot;sever ready&quot;);
  });
  
  </code></pre>
  <p>NPM COMMAND:</p>
  <pre><code>nodemon ts-node ./src/index.ts
  </code></pre>
  <p>In this case, on server start, we can observe &quot;This is a testable offence&quot; is being printed.</p>
  <p>But the message &quot;Inside Route&quot; is only printed when the route is hit.</p>
  <p>can anyone explain the reason for the same ?</p>