title: POST Data JSON Validation in Express.js
body: <p>I'm writing an app using Node.js and Express.js. The app has a (small) REST API and then a web front end. I use MongoDb.</p>
  
  <p>For the API, I tend <code>POST</code> data to some endpoint and then do processing or whatever, and dump it in a database. However, I have some database schema I would like to enforce. What are my options / best practices for enforcing a specific structure on my <code>POST</code> data so I know that certain fields are present and of specific types.</p>
  
  <p>It would be nice if this could be done at the middleware level, but it isn't necessary. What do people usually do for validation / schema enforcement?</p>