Skip to content

Commit 277d222

Browse files
authoredApr 4, 2024
Merge pull request #81 from definecoder/aws-backend
Aws backend added for testing
2 parents 38dff3e + 01cc50f commit 277d222

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed
 

‎README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ Go to the source directory and give the following command
8181
```bash
8282
docker compose up --build
8383
```
84+
## To run using AWS Backend (if docker compose fails)
85+
Go to `client\data\apiRoutes` and comment the `first line` and uncomment the second
86+
```js
87+
export const baseUrl = "http://localhost:8585"; // Uncomment to run Locally
88+
// export const baseUrl = "http://13.250.36.61"; // Uncomment to run in AWS
89+
```
90+
When running on AWS the frontend might face some slow network problems which can be fixed by switching speed from no thorttling to fast 3G. [You can check this video to see the demonstration of the problem mentioned here](https://drive.google.com/drive/folders/1B5N5o0ms7mizSYm5HNiAjJj0O82Zb1tq?usp=sharing).
91+
8492
## License
8593

8694
[MIT](https://choosealicense.com/licenses/mit/)

‎client/components/dataTables/BillBySTSId.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import EmptyFillContainer from "../dashboard-componenets/cards/EmptyFillContaine
1717
import { getCookie } from "@/lib/cookieFunctions";
1818
import { admin } from "@/data/roles";
1919
import { Button } from "../ui/button";
20+
import { baseUrl } from "@/data/apiRoutes";
2021

2122
const dummyDataArray: ScheduleEntry[] = [
2223
{
@@ -97,7 +98,7 @@ export function BillBySTSId({ stsId, date }: { stsId: string; date: string }) {
9798
try {
9899
// fetch data from api
99100
const res: any = await axios.get(
100-
"http://localhost:8585/schedules/search?date=" +
101+
baseUrl + "/schedules/search?date=" +
101102
date +
102103
"&stsId=" +
103104
stsId,
@@ -126,7 +127,7 @@ export function BillBySTSId({ stsId, date }: { stsId: string; date: string }) {
126127
try {
127128
// fetch data from api
128129
const res: any = await axios.post(
129-
"http://localhost:8585/schedules/create/" + date,
130+
baseUrl + "/schedules/create/" + date,
130131
{
131132
headers: {
132133
Authorization: `Bearer ${localStorage.getItem(jwtToken)}`,

‎client/data/apiRoutes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const baseUrl = "http://localhost:8585";
1+
export const baseUrl = "http://localhost:8585"; // Local
2+
// export const baseUrl = "http://13.250.36.61"; // AWS
23

34
export const apiRoutes = {
45
auth: {

0 commit comments

Comments
 (0)
Please sign in to comment.