title: Express fails to find resources in case of parameterized route. What am I missing?
body: <p>In my express app I have a separate file for middlewares. I used express.static to make the resources available to the app. Code from middlewares.js...</p>
  
  <pre><code>app.use(express.static('public'));
  app.use(express.static('node_modules/vue/dist'));
  app.use(express.static('node_modules/bootstrap/dist/css'));
  app.use(express.static('node_modules/bootstrap/dist/js'));
  app.use(express.static('node_modules/multiple.js'));
  app.use(express.static('node_modules/chart.js/dist'));
  </code></pre>
  
  <p>It works fine for all the routes. However, when I try to define a parameterized route, and render a template this way, it fails to load up the resources. Express fails to find CSS/JS/Image files from those statics. What am I missing here? Here is my code for the route..</p>
  
  <pre><code>app.get('/invoices/:id', app.authenticated, (req, res) =&gt; {
      Invoices.find({_id: req.params.id}, (err, invoice) =&gt; {
          if (err) {
              res.json({error: err});
          }
          res.render('invoicesCreate');
      });
  });
  </code></pre>
  
  <p>Updated: The View file</p>
  
  <pre><code>{{#section 'classes'}}has-navigation page-dashboard{{/section}}
  {{#section 'body-classes'}}-fluid{{/section}}
   &lt;div class="row" id="invoicer"&gt;
    &lt;div class="col-xs-12 col-md-6"&gt;
     Fill your details and get live preview in the right side
       &lt;form class="" action="/invoices" method="post" enctype="multipart/form-data"&gt;
    &lt;div class=""&gt;
      &lt;div class="invoiceform-logo-container"&gt;
        &lt;input type="file" name="profilelogo" id="fileinput" accept="image/*" v-on:change="updateImage()"&gt;
        &lt;img v-bind:src="logo" alt="" /&gt;
      &lt;/div&gt;
      &lt;div class="invoiceform-number"&gt;&lt;/div&gt;
      &lt;div class="invoiceform-currency"&gt;&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="divider"&gt;&lt;/div&gt;
    &lt;div class=""&gt;
      Your Name / Company Name
      &lt;textarea name="company_name" rows="8" cols="40" v-model="from"&gt;&lt;/textarea&gt;
      Client Name / Company Name
      &lt;textarea name="client_name" rows="8" cols="40" v-model="to"&gt;&lt;/textarea&gt;
  
      \{{date_title}}
      &lt;input type="date" name="start_date" v-model="date"&gt;
  
      \{{due_date_title}}
      &lt;input type="date" name="end_date" v-model="due_date" v-bind:min="date"&gt;
  
      \{{balance_title}} \{{balance}}
      &lt;div class="input-group"&gt;
        &lt;span class="input-group-addon"&gt;$&lt;/span&gt;
        &lt;input name="end_date" type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="invoiceform-itemlist" v-on:focusout="checkToRemove()"&gt;
      &lt;div class=""&gt;
        \{{item_header}}
        \{{quantity_header}}
        \{{unit_cost_header}}
        \{{amount_header}}
      &lt;/div&gt;
      &lt;div class="" v-for="item in items"&gt;
        &lt;input type="text" name="items[1][item_name]" v-model="item.head"&gt;
        &lt;input type="number" name="items[1][item_quantity]" v-model="item.quantity" min="0" v-on:blur="updateAmount($index)"&gt;
        &lt;input type="number" name="items[1][item_rate]" v-model="item.rate" min="0" v-on:blur="updateAmount($index)"&gt;
        &lt;input type="number" name="items[1][item_amount]" v-model="item.amount"&gt;
      &lt;/div&gt;
      &lt;button type="button" name="button"&gt;Add Item&lt;/button&gt;
    &lt;/div&gt;
  
    &lt;div class="divider"&gt;&lt;/div&gt;
    &lt;div class=""&gt;
      \{{subtotal_title}} \{{subtotal}}
      \{{tax_title}}
  
      &lt;div class="input-group"&gt;
        &lt;input type="text" class="form-control" aria-label="Text input with dropdown button" v-model="tax"&gt;
        &lt;span class="input-group-addon"&gt;
          &lt;input type="radio" name="" aria-label="Checkbox for following text input"&gt; %
        &lt;/span&gt;
        &lt;span class="input-group-addon"&gt;
          &lt;input type="radio" name="" aria-label="Checkbox for following text input"&gt; F
        &lt;/span&gt;
      &lt;/div&gt;
  
      &lt;div id="discount" v-if="fields.discount"&gt;
        Discount &lt;input type="number" name="" v-model="discounts"&gt;
      &lt;/div&gt;
      &lt;div id="shipping" v-if="fields.shipping"&gt;
        Shipping &lt;input type="number" name="shipping" v-model="shipping"&gt;
      &lt;/div&gt;
      &lt;div class="btn-group" data-toggle="buttons"&gt;
        &lt;label class="btn btn-primary"&gt;
          &lt;input type="checkbox" name="discount" v-model="fields.discount"&gt; \{{discounts_title}}
        &lt;/label&gt;
        &lt;label class="btn btn-primary"&gt;
          &lt;input type="checkbox" name="shipping" v-model="fields.shipping"&gt; \{{shipping_title}}
        &lt;/label&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="divider"&gt;&lt;/div&gt;
    &lt;div class=""&gt;
      Total &lt;input type="number" name="name" v-model="total" min="0"&gt;
      \{{amount_paid_title}} &lt;input type="number" name="total" v-model="amount_paid" min="0" v-bind:max="total"&gt;
    &lt;/div&gt;
  
    &lt;div class="divider"&gt;&lt;/div&gt;
    &lt;div class=""&gt;
      \{{notes_title}}
      &lt;input type="text" name="name" v-model="notes"&gt;
      \{{payment_terms_title}}
      &lt;input type="text" name="name" v-model="terms"&gt;
      &lt;button type="submit" name="button"&gt;Save Now&lt;/button&gt;
      &lt;button type="button" name="button"&gt;Download PDF&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  
       &lt;/div&gt;
       &lt;div class="col-xs-12 col-md-6 hidden-sm-down"&gt;&lt;/div&gt;
     &lt;/div&gt;
   {{#section 'script'}}
    window.invoice = {{{json defaultInvoice}}}
    console.log({{{json defaultInvoice}}})
   {{/section}}
  </code></pre>