title: What is the correct way in node.js Express to show a spinner while performing a time consuming post?
body: <p>I have a post which kicks off a large processing task which can take upwards of half a minute.</p>
  
  <p>What is the correct way to send back to the response a spinner and then when the task completes redirect or show the results?</p>
  
  <p>Should I use render() on a temporary view, and then use redirect() asynchronously when the task finishes?</p>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>exports.postForm = function (req, res) {
  console.log('postForm');
  logger.info('Request Data:' + JSON.stringify(req.body));
  
  // Do big task here... but how to tell user its happening?
  
  };
  </code></pre>
  
  <p>Update - More details on the problem:</p>
  
  <p>So the specific problem I have is this: When I hit submit button, the post comes back to this route in Express. From here I can send content or redirect, whatever I want. Say I redirect to a "Processing" page, then kick off an asynchronous call to start the data collection. How then, when that is done, can I redirect again to the "Processing Complete" page? </p>
  
  <p>I suspect I may need to do all this in Socket.IO and not use html post to submit the form. I guess then I can "on click" use socket.io to submit the data, and then i could in an AJAX like fashion rewrite part of the webpage to indicate "processing" and then when I get the event to say complete via socket.io I could rewrite the page again to say done. Does this seem like the best way forward?</p>