node.js - Test nodejs using postman: How to get req.user in postman -
i'm using passport register & login function. api this:
router.post('/secret', ctr); (req, res, next) => { if (req.user) { ... } }
how test api using postman?
your question not clear. first refer postman documentation.
if trying achieve send in "user" field in postman set method post
, , content-type
application/json
, send in valid json body "user" field in request.
your node app should have body-parser installed well.
Comments
Post a Comment