A simple file sharing site with an easy to use API and online panel.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

14 行
372B

  1. const verify = require('./verify.js');
  2. // Verifies the entire request query is well formed
  3. const verifyQuery = expected => async (req, res, next) => {
  4. try {
  5. await Promise.all(expected.map(e => verify(req.query[e.name], e)));
  6. next();
  7. } catch(err) {
  8. res.status(err.code).json({message: err.message});
  9. }
  10. };
  11. module.exports = verifyQuery;