I am tring to create a demo API server using node.js
, express4
and body-parser
. I am trying to secure it using some Api-Key
which will have to be passed in the request header. However, I am not able to do it.
I tried
console.log(bodyParser.getheader("Api-Key"))
and
console.log(app.getheader("Api-Key"))
but in both cases I get the error
getheader is not a function
So now can I read headers using body parser?