title: Serving static files in Express dese not work
body: <p>I have a folder named <code>public</code> in  the root of my project . I would like to put all my images/css in that.</p>
  
  <p>Now, I want to put the serving static section in the separate module named config:</p>
  
  <pre><code>//config.js
  
  const express = require('express');  
  module.exports = function (app) {
     app.use("/static", express.static(__dirname + '/public'));
  }
  </code></pre>
  
  <p>then in the <code>server.js</code></p>
  
  <pre><code>const express = require('express')
  const app = express();
  
  require('./startup/config')(app);
  
  app.get('/', (req, res, next) =&gt; {
      res.send("Hi, How's it going ?")
  })
  
  app.listen(4500, () =&gt; {
      console.log("Server is running ...");
  })
  </code></pre>
  
  <p>Now, when I want to call the following address </p>
  
  <pre><code>http://localhost:4500/static/xxx.jpg
  </code></pre>
  
  <p>I get the following error </p>
  
  <pre><code>Cannot GET /static/xxx.jpg
  </code></pre>
  
  <p>Structure Of Project :</p>
  
  <pre><code>-node_modules
  -server.js
  -public
  -------xxx.jpg
  </code></pre>