0Learn commited on
Commit
4ef0326
·
verified ·
1 Parent(s): e500c67

Update frontend.py

Browse files
Files changed (1) hide show
  1. frontend.py +2 -3
frontend.py CHANGED
@@ -6,9 +6,8 @@ history = []
6
 
7
  def calculate(expression):
8
  try:
9
- # Use the current page's URL to construct the API endpoint
10
- api_url = gr.get_url() + "/calculate"
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('.')