title: Node JS POST | PUT body validation
body: <p>In <strong>production</strong> level environments what is more or less the standard for POST / PUT body validation?</p>
  
  <p>My approach has always been something like:</p>
  
  <pre><code>const isValid = (req.body.foo &amp;&amp; /[a-z0-9]*/i.test(req.body.foo))
  </code></pre>
  
  <p>Only checking that the variable exists and does not contain unexpected characters.</p>