express-http-proxy
express-http-proxy copied to clipboard
How to debug?
Hi I am trying to use the code in a serverless environment where I do not have control over the node VM arguments. How to I print out when the proxy request url and headers are?
Seems like you have the functionality in the trace debugging module, how to I get that to print to console.log? I am stuck doing surgery to proxyReq ATM, and its not at all obvious where the body and URL is.
Hi @tomlarkworthy. Interesting.
The expected use is to set an environmental variable to trigger debug logging to stdout (what I think you mean by console.log).
DEBUG=express-http-proxy npm run YOUR_PROGRAM
DEBUG=express-http-proxy npm run YOUR_PROGRAM | grep 'express-http-proxy' # to filter down to just these messages
I think you are saying that in your environment, you can't set environmental variables? If this is correct, what kinds of messages can you send to the software? How would you like this to work?
Thanks
@tomlarkworthy in can just set DEBUG=express-http-proxy
as an environment variable to your serverless function. It's possible at least in Azure Functions and AWS Lambda.
This documentation is terrible. Make it clear that this is setting an environment variable. So difficult to debug this