Get the response data from target server with express

Aperta
#1,640 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
express, node.js
Ambito
api, backend

Direzione di ricerca

Inizia con l'endpoint app.post('/ChatHandler.php') e la chiamata proxy.web diretta a http://localhost:8081/ChatHandler.php. Leggi la documentazione di node-http-proxy sulla gestione delle risposte e identifica come sia possibile osservare la risposta JSON inoltrata prima che raggiunga il client; il lavoro è considerato completato quando l'approccio documentato affronta questa domanda sull'utilizzo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
14.1k
Fork
2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di http-party/node-http-proxy

Tutte le issue di http-party/node-http-proxy

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.