From cf2fd8e3887221ea448b3dc71aa1ada5cdeeaf21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 10 Jun 2024 11:09:31 +0200 Subject: [PATCH] frontend: Proxy prod backend for local development (#789) --- frontend/config/webpack.dev.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frontend/config/webpack.dev.js b/frontend/config/webpack.dev.js index 6296df1..f8cea71 100644 --- a/frontend/config/webpack.dev.js +++ b/frontend/config/webpack.dev.js @@ -17,14 +17,13 @@ const dev = { stats: "errors-only" }, historyApiFallback: true, - // feel free to delete this section if you don't need anything like this - onBeforeSetupMiddleware: function (devServer) { - // on port 3000 - devServer.app.get("/test", function (req, res) { - res.json({result: "You reached the dev server"}); - }); - - } + proxy: { + '/backend': { + target: 'https://nixos-search-7-1733963800.us-east-1.bonsaisearch.net/', + pathRewrite: {'^/backend' : ''}, + changeOrigin: true + }, + }, }, };