From 5561a8694dc0e7d0458e318ddb50cfd0071cb739 Mon Sep 17 00:00:00 2001 From: wyhong3103 Date: Tue, 20 Feb 2024 01:21:06 +0800 Subject: [PATCH] Update the app and add README --- frontend/.env | 3 +++ frontend/app/components/PuzzleGrid.tsx | 2 +- frontend/app/screens/ImportScreen/ImportScreen.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 frontend/.env diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..cbf49cd --- /dev/null +++ b/frontend/.env @@ -0,0 +1,3 @@ +# Your backend address +# If this is in localhost, you can use ipconfig to find your IPv4 address (in windows) +EXPO_PUBLIC_API_URL=http://192.168.0.175:3030 \ No newline at end of file diff --git a/frontend/app/components/PuzzleGrid.tsx b/frontend/app/components/PuzzleGrid.tsx index e0b09af..cbcabc7 100644 --- a/frontend/app/components/PuzzleGrid.tsx +++ b/frontend/app/components/PuzzleGrid.tsx @@ -14,7 +14,7 @@ export const PuzzleGrid : FC = ({puzzle, mask, cb, disabled}) = const rows = [] for(let i = 0; i < 9; i++){ rows.push( - + { puzzle[i].map( (value: number, idx: number) => ( diff --git a/frontend/app/screens/ImportScreen/ImportScreen.tsx b/frontend/app/screens/ImportScreen/ImportScreen.tsx index 58eedbe..d22dceb 100644 --- a/frontend/app/screens/ImportScreen/ImportScreen.tsx +++ b/frontend/app/screens/ImportScreen/ImportScreen.tsx @@ -21,7 +21,7 @@ export const ImportScreen: FC = ({navigation}) => { type: "image/jpeg" }) - const res = await fetch('http://ec2-13-211-177-226.ap-southeast-2.compute.amazonaws.com:3030/inference', { + const res = await fetch(process.env.EXPO_PUBLIC_API_URL+'/inference', { method: 'POST', body: formData, });