Closed hiagodotme closed 6 years ago
Honestly, I don't think that it is a Nest related issue. Besides, if you want to create a proxy and nothing else, you probably don't need Nest at all.
Hello, @kamilmysliwiec First of all, thank you for your response. In my case, it is necessary to make use of the Proxy and still have NestJS. One advantage of doing this is to use the same HTTP port, since I need to do some implementations on nodejs.
I agree with you, thinking about it, this is not NestJS's problem. But I found a solution that served me very well. I'll share if anyone needs something like that.
To solve the problem:
In main.ts right after my const app = await NestFactory.create (AppModule);
I have added the following lines:
app.use ('__bank-agency-gateway', proxy(config.endpoints.bankAgencyGateway));
app.use ('__bank-account', proxy(config.endpoints.bankAcountCenter));
app.use ('__bank-safebox', proxy(config.endpoints.bankSafebox));
app.use ('__visa-proxy', proxy(config.endpoints.visaProxy));
And I used the express-http-proxy
proxy library ie the requests that are not directed to my proxys NestJS can act.
Thank you
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm submitting a...
I created a proxy with the nestjs. Any request other than GET does not work.
StackOverflow Answer: https://stackoverflow.com/questions/50236234/create-proxy-in-nestjs
Code: