From e6f08e4c4937490333209aa2ad67e75a55659a16 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 30 Sep 2024 23:53:35 +0530 Subject: [PATCH] feat: POST proxy config --- src/api/proxy.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/api/proxy.ts diff --git a/src/api/proxy.ts b/src/api/proxy.ts new file mode 100644 index 00000000..ff91d43f --- /dev/null +++ b/src/api/proxy.ts @@ -0,0 +1,15 @@ +import { default as axios } from "axios"; + +export const sendProxyConfig = async (proxyConfig: {}): Promise => { + try { + const response = await axios.post(`http://localhost:8080/proxy/config`); + if (response.status === 200) { + return response.data; + } else { + throw new Error(`Failed to submit proxy configuration. Try again.`); + } + } catch(error: any) { + console.log(error); + return false; + } + } \ No newline at end of file