Spaces:
Sleeping
Sleeping
Update frontend.py
Browse files- frontend.py +2 -3
frontend.py
CHANGED
|
@@ -6,9 +6,8 @@ history = []
|
|
| 6 |
|
| 7 |
def calculate(expression):
|
| 8 |
try:
|
| 9 |
-
# Use
|
| 10 |
-
|
| 11 |
-
response = requests.post(api_url, json={"expr": expression})
|
| 12 |
if response.status_code == 200:
|
| 13 |
result = response.json()["result"]
|
| 14 |
result_str = f"{result:.8f}".rstrip('0').rstrip('.')
|
|
|
|
| 6 |
|
| 7 |
def calculate(expression):
|
| 8 |
try:
|
| 9 |
+
# Use a relative URL for the API endpoint
|
| 10 |
+
response = requests.post("/calculate", json={"expr": expression})
|
|
|
|
| 11 |
if response.status_code == 200:
|
| 12 |
result = response.json()["result"]
|
| 13 |
result_str = f"{result:.8f}".rstrip('0').rstrip('.')
|