diff --git a/src/App.tsx b/src/App.tsx index b92ab51..a8bfa6b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -189,7 +189,7 @@ function App() { setSignedMessage(null); setView(View.CONNECT); - await axios.post(BRIDGE_URL + '/disconnect', { + await axios.post(BRIDGE_URL + '/api/disconnect', { providerId: window.localStorage.getItem('providerId'), }); } diff --git a/src/components/connectOverlay/ConnectOverlay.tsx b/src/components/connectOverlay/ConnectOverlay.tsx index b6bd52f..1839980 100644 --- a/src/components/connectOverlay/ConnectOverlay.tsx +++ b/src/components/connectOverlay/ConnectOverlay.tsx @@ -98,9 +98,12 @@ const ConnectOverlay: React.FC = ({ window.localStorage.removeItem('walletconnect'); window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE'); - const response = await axios.post(BRIDGE_URL + '/init-provider', { - wallet: wallet, - }); + const response = await axios.post( + BRIDGE_URL + '/api/init-provider', + { + wallet: wallet, + } + ); const providerId = response.data.providerId; const uri = response.data.uri; @@ -121,7 +124,7 @@ const ConnectOverlay: React.FC = ({ try { const statusResponse = await axios.post( - BRIDGE_URL + '/is-connected', + BRIDGE_URL + '/api/is-connected', { providerId: providerId, withCredentials: true, @@ -203,7 +206,7 @@ const ConnectOverlay: React.FC = ({ window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE'); dispatch(setConnectionState('disconnected')); - await axios.post(BRIDGE_URL + '/disconnect', { + await axios.post(BRIDGE_URL + '/api/disconnect', { providerId: window.localStorage.getItem('providerId'), headers: { 'Content-Type': 'application/json', diff --git a/vite.config.ts b/vite.config.ts index 482c5cc..fe1179d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,5 +11,12 @@ export default defineConfig({ base: './', server: { port: 5174, + proxy: { + '/api': { + target: 'https://ns3113082.ip-145-239-205.eu:3000', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, ''), + }, + }, }, });