Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the response data from target server with express #1640

Open
Teenymario opened this issue Jul 30, 2023 · 0 comments
Open

Get the response data from target server with express #1640

Teenymario opened this issue Jul 30, 2023 · 0 comments

Comments

@Teenymario
Copy link

Teenymario commented Jul 30, 2023

I have a node.js application that runs with express and with http-proxy.
Now the express server is where client requests come in and then the requests are forwarded to an internal php server
I have an endpoint that forwards requets to a php file called chatHandler.php which would respond with json data back to the client.
I would like to read the json response the internal server gives.
This is how the endpoint looks
app.post('/ChatHandler.php', (req, res, next) => { proxy.web(req, res, { target: 'http://localhost:8081/ChatHandler.php' }, next); });
Before the request is returned to the client I want to see what the response from "http:localhost:8081/ChatHandler.php" was, like the body of the response where the json data is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant