Fix jwt-token
This commit is contained in:
@@ -9,10 +9,20 @@ import requests
|
||||
import json
|
||||
import time
|
||||
import math
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
# Configuration
|
||||
API_BASE_URL = "http://selfservice.cqers.com/drones/api"
|
||||
# Configuration from environment variables
|
||||
API_BASE_URL = os.getenv('API_BASE_URL', 'http://localhost:3002/api')
|
||||
BASE_PATH = os.getenv('VITE_BASE_PATH', '').rstrip('/')
|
||||
|
||||
# If BASE_PATH is set, construct the full URL
|
||||
if BASE_PATH and not API_BASE_URL.endswith('/api'):
|
||||
# Extract domain from API_BASE_URL and add base path
|
||||
domain = API_BASE_URL.replace('/api', '').replace('/drones/api', '').replace('/uggla/api', '')
|
||||
API_BASE_URL = f"{domain}{BASE_PATH}/api"
|
||||
|
||||
print(f"🔗 Using API Base URL: {API_BASE_URL}")
|
||||
|
||||
def haversine_distance(lat1, lon1, lat2, lon2):
|
||||
"""Calculate distance between two points in kilometers"""
|
||||
|
||||
Reference in New Issue
Block a user