I am setting a correlation Id in node js application & I need to access it in the frontend to pass in the request again. Not sure how to access.
For further actions, you may consider blocking this person and/or reporting abuse
I am setting a correlation Id in node js application & I need to access it in the frontend to pass in the request again. Not sure how to access.
For further actions, you may consider blocking this person and/or reporting abuse
ANIRUDDHA ADAK -
Rohith Singh -
Raj Nandan Sharma -
Shafayet Hossain -
Top comments (5)
It would depend what you are using on the frontend to make the request.
If you are using the fetch API (native in all browsers except IE) you can access the response headers
developer.mozilla.org/en-US/docs/W...
I would probably look for a monitoring tool to do this for you though, like datadog or AWS Cloudwatch or Azure Applications Insights.
What are you using in nodejs?
Built-in http server has
res.setHeader
, while express hasres.header
method for that.Do you have an example of this?
In my node server
I have did like res.set( correlationid, 12345)
I need to access the value from frontend react, response.headers in frontend not able to get the correlationid
Do you want to set headers on the node?, maybe this example could be used
stackoverflow.com/questions/767626...
or