From 2425073ea23f0210968df8363a0434fdafc9acfb Mon Sep 17 00:00:00 2001 From: RickyAdriell <53133228+codecplyre@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:44:49 +0100 Subject: [PATCH] fix bug in post requets and put request https://github.com/chimurai/http-proxy-middleware/issues/40 https://stackoverflow.com/questions/25207333/socket-hang-up-error-with-nodejs/25651651\#25651651 --- srcs/api-gateway/server.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srcs/api-gateway/server.js b/srcs/api-gateway/server.js index 150d314..2dc32eb 100644 --- a/srcs/api-gateway/server.js +++ b/srcs/api-gateway/server.js @@ -9,9 +9,8 @@ dotenv.config(); const app = express(); const port = process.env.API_GATEWAY_PORT || 3000; +app.use('/api/movies', proxyMiddleware(process.env.MOVIES_API_URL)); app.use(bodyParser.json()); -app.use('/api', proxyMiddleware(process.env.MOVIES_API_URL)); - routes(app); connectQueue(process.env.RABBITMQ_URL); app.listen(port, () => {