title: Webpack dev server "before" functionality
body: <p>I'm working on an ejected Create React App project, and looking at the docs on webpack dev server, they seem a little bare: <a href="https://webpack.js.org/configuration/dev-server/#devserver-before" rel="nofollow noreferrer">https://webpack.js.org/configuration/dev-server/#devserver-before</a></p>
  
  <p>but I'm trying to see if it's possible to do something like:</p>
  
  <pre><code>before(app){
    // read cookie for user session
    // send user ID in cookie to external API
    // retrieve user object from API
    // attach user object to response, to be _somehow_ accessed via the React app client side
  }
  </code></pre>
  
  <p>I know this is pseudo code, but I'm very unclear about what <em>exactly</em> you can do within this middleware, in terms of hooking into Create React App's rendering of the index.html and aforementioned client-side React app</p>
  
  <p>In the docs, it says you could define a route handler, like so:</p>
  
  <p><code>app.get('/some/path', function(req, res) {  }</code></p>
  
  <p>but I don't feel like that's going to be useful, as you wouldn't then be able to hook back into Webpack dev server's rendering process?</p>