Skip to content

Commit

Permalink
updated proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pushkarm029 committed Oct 21, 2023
1 parent e845452 commit 187141f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion frontend/Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /app/frontend
COPY ./package.json ./
COPY ./package-lock.json ./
EXPOSE $PORT
RUN npm ci
RUN npm i
COPY ./ ./
CMD [ "npm", "start"]

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__tests__/explore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('Explore', () => {

render(<Explore />);
const imgElements = document.querySelectorAll('.exploreImages img');
await waitForElementToBeRemoved(() => screen.getByText('Loading Bro......'), { timeout: 10000 }); // Wait for up to 10 seconds
await waitForElementToBeRemoved(() => screen.getByText('Loading Bro......'), { timeout: 10000 });
imgElements.forEach((img, index) => {
expect(img).toHaveAttribute('src', fakeData[index].userPosts[0].image_link);
});
Expand Down
34 changes: 17 additions & 17 deletions frontend/src/setupProxy.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// const { createProxyMiddleware } = require('http-proxy-middleware');

// module.exports = function (app) {
// const target = process.env.API_PROXY_TARGET || 'http://localhost:8080'; // Default to localhost:8080 if the env variable is not set

// app.use(
// '/api',
// createProxyMiddleware({
// target,
// changeOrigin: true,
// // secure: false,
// })
// );
// };

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
const target = process.env.API_PROXY_TARGET || 'http://localhost:8080'; // Default to localhost:8080 if the env variable is not set

app.use(
'/api',
createProxyMiddleware({
target: 'http://localhost:8080',
target,
changeOrigin: true,
// secure: false,
})
);
};
};

// const { createProxyMiddleware } = require('http-proxy-middleware');

// module.exports = function (app) {
// app.use(
// '/api',
// createProxyMiddleware({
// target: 'http://localhost:8080',
// changeOrigin: true,
// })
// );
// };

0 comments on commit 187141f

Please sign in to comment.