Skip to content

Commit

Permalink
backend url
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanireland committed May 3, 2024
1 parent 9b06522 commit f2ff67d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/src/apiClient.ts
Original file line number Diff line number Diff line change
@@ -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<boolean> {
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' },
});

Expand All @@ -14,7 +16,7 @@ export async function claim(publicKey: string): Promise<boolean> {
}

export async function checkUser(publicKey: string): Promise<boolean> {
const response = await axios.get('http://localhost:3001/user', {
const response = await axios.get(`${url}/user`, {
params: { publicKey: publicKey },
});

Expand All @@ -26,7 +28,7 @@ export async function checkUser(publicKey: string): Promise<boolean> {
}

export async function checkMax(): Promise<boolean> {
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;
Expand Down

0 comments on commit f2ff67d

Please sign in to comment.