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

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

image - python get coordinates (pixels) of corresponding points from clicks -