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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -