mardi 3 février 2015

How to handle boolean req.query parameter in node?


Imagine following request:



http://ift.tt/1Apk4QP


In the API code you check:



if(req.query.wantsResponse){
//...
}


This is always true, event if wantsResponse is false. Does the if just check if wantsResponse has a value? I am confused.





Aucun commentaire:

Enregistrer un commentaire