title: Use ExpressJS app via FastCGI
body: <p>Just started deal with NodeJS web apps and have a fundamental question.</p>
  
  <p>Since i came from the PHP realm, i know PHP have a <a href="http://www.php.net/manual/en/features.commandline.webserver.php" rel="noreferrer">built-in HTTP server</a> but no one actually use it and we used nginx and in the prehistoric projects Apache as HTTP server, when i came into ExpressJS i found that all examples talking about listening to the HTTP server that ExpressJS open (via http NodeJS module of-course) but no one talking about use it via FastCGI (nginx -> FastCGI (e.g. <a href="https://www.npmjs.org/package/node-fastcgi" rel="noreferrer">node-fastcgi</a>) -> my ExpressJS app) like i used to do with PHP (nginx -> PHP-fpm -> my PHP env) and i wonder why? </p>
  
  <p>As far as i understood, NodeJS app is very fast, non-blocking I/O and so on but there is a security hole using the app like everybody show, since the service that run have same common resources in the JavaScript environment, one user can share by mistake (or not) sensitive information with others, for instance. let's assume the developer made a mistake like this: </p>
  
  <pre><code>router.post('/set-user-cc', function(res){
      global.user = new User({
          creditCard: req.param('cc')
      });
  });
  </code></pre>
  
  <p>And other user do request like that:</p>
  
  <pre><code>router.get('/get-user-cc', funciton(req, res){
      res.json(global.user);
  });
  </code></pre>
  
  <p>At this point each user will get the user's CC info.</p>
  
  <p>Using my ExpressJS app via FastCGI will open a clean JavaScript environment for each HTTP request and users won't hurt each other.</p>
  
  <p>It'll nice to hear form NodeJS (web) apps experienced developers why no one suggest to use the FastCGI solution (searched on Google and found almost nothing) and if so, why it's too bad?</p>
  
  <p>(p.s. the example is just to demonstrate the problem it's not something that someone actually did, but as we know lot of stupid people exists in the universe :)</p>
  
  <p>Thank you!</p>