title: Express JS: how to know if request is for static asset?
body: <p>I am writing middleware for some specific task, which should <strong>not</strong> be executed when request is for static assets (from client folder: app.use(express.static(path.join(__dirname, "../client")));)</p>
  
  <p>So how can i know that particular request is for static asset or is being served from "client" folder?</p>
  
  <p>I have below code </p>
  
  <pre><code>app.use(express.static(path.join(__dirname, "../client")));   
  app.use(someCustomMiddleware()); 
  </code></pre>
  
  <p>i am seeing that requests for static assets like for css/js files is still going thru someCustomMiddleware(). My requirement is that someCustomMiddleware() should not process request for static assets.</p>