title: How to serve dynamic static files in express JS
body: <p>I am trying to render static file. I came across the sendFile() method but it is not working with proxy. I need help.
  Here is my code.</p>
  <pre><code>var express = require('express');
  const proxy = require('express-http-proxy');
  var process = require('process');
  
  var app = express();
  app.set('port', (process.env.PORT || 8080));
  
  app.use('$Variable',  express.static(__dirname + '$Variable'));
  app.use('/', proxy(function(request, response) {
    return 'http://localhost:8000' + request.url
  }))
  
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = &quot;0&quot;;
  app.listen(app.get('port'));
  setTimeout(function() {
    process.exit();
  }, 100000);
  </code></pre>
  <p>I want something like this does anyone has idea?
  What can I do to replace the $variable with path to my files.
  NOTE: $VARIABLE is just there to showcase what I am trying to mean. It does not means that I am trying to use PHP in node.js. Think before you become a professor.</p>