title: How to handle all routes express
body: <p>There is a nodejs (express) app.
  It has few router handlers.
  I want the app after getting SIGTERM to respond with 500 status to all the routes.
  How can I achieve that?
  I tried:</p>
  
  <pre><code>process.on('SIGTERM', () =&gt; {
      console.log('SIGTERM CATCHED');
  
      app.use((req, res) =&gt; {
          console.log('RESPONDING PROPERLY')
          res.sendStatus(500);
      })
  });
  </code></pre>
  
  <p>But that would definitely not override the more specific handlers.
  Additionally, I shouldn't shutdown the app.</p>