From f2ff67d4b79756d08b765418c25cc27dd081735e Mon Sep 17 00:00:00 2001 From: Dylan Ireland Date: Fri, 3 May 2024 02:21:40 -0400 Subject: [PATCH] backend url --- client/src/apiClient.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/apiClient.ts b/client/src/apiClient.ts index 31d7352..29fdc3f 100644 --- a/client/src/apiClient.ts +++ b/client/src/apiClient.ts @@ -1,8 +1,10 @@ import axios from 'axios'; +const url = "http://ec2-18-191-174-59.us-east-2.compute.amazonaws.com:3001" + export async function claim(publicKey: string): Promise { const data = { publicKey: publicKey }; - const response = await axios.post('http://localhost:3001/saveUser', data, { + const response = await axios.post(`${url}/saveUser`, data, { headers: { 'Content-Type': 'application/json' }, }); @@ -14,7 +16,7 @@ export async function claim(publicKey: string): Promise { } export async function checkUser(publicKey: string): Promise { - const response = await axios.get('http://localhost:3001/user', { + const response = await axios.get(`${url}/user`, { params: { publicKey: publicKey }, }); @@ -26,7 +28,7 @@ export async function checkUser(publicKey: string): Promise { } export async function checkMax(): Promise { - const response = await axios.get('http://localhost:3001/max'); + const response = await axios.get(`${url}:3001/max`); if (response.status == 200) { return response.data as boolean;