title: hapi catch all route without assets folder 404 status
body: <p>I'm working on a SPA
  and I want to manage the 404 status
  but without using a separate folder
  (assets in this case)</p>
  
  <pre><code>server.route(
      {    // Angular/API Route
          method: 'GET',
          path: '/api',
          handler: function (request, reply) {
               reply( {api: 'response' } )
          }
      });
  
      server.route({    // Other assets If you have
          method: 'GET',
          path: '/assets/{param*}',
          handler: {
          directory: {
              path: './assets',
              listing: false,
              index: true
          }
      });
  
      server.route({   // Everything else 
          method: 'GET',
          path: '/{p*}',
          handler: function (request, reply) {
              reply.file('public/html/index.html');
          }
      });
  </code></pre>
  
  <p>I mean I've got a deploy like</p>
  
  <p><img src="https://i.stack.imgur.com/sC1El.jpg" alt="deploy"></p>
  
  <p>so if I use assets I've to change all my deploy
  and gulpfile.</p>
  
  <p>Is there a way to manage 404 status without using
  an extra folder ?</p>
  
  <p><strong>UPDATE</strong>
  by now I worked it out following the tip of @Matt Harrison</p>
  
  <pre><code>server.ext('onPreResponse', function (request, reply) {
      var req = request.response;
      if (req.isBoom &amp;&amp; (req.output.statusCode===404)) {
        return reply.redirect('/#!/404');
      }
      return reply.continue();
  });
  </code></pre>