Guest User

Untitled

a guest
Nov 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. const authGuard = require("../middlewares/authGuard");
  2.  
  3. router.get("/search", authGuard, (req, res, next) => {
  4. var query = req.param("query");
  5.  
  6. Drug.find( {name: new RegExp(query, "i")}) .then(items => {
  7. res.json(items);
  8. });
  9. });
Add Comment
Please, Sign In to add comment