From b21ed65133a12a9882ce521e76bbd700d5a9b177 Mon Sep 17 00:00:00 2001
From: ='fauz <='fauzgabriel@gmail.com>
Date: Thu, 3 Jul 2025 02:55:12 +0700
Subject: [PATCH] global accessor
---
app/routes.py | 4 ++++
templates/index.html | 27 ++++++++++++++-------------
templates/map.html | 27 ++++++++++++++-------------
3 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/app/routes.py b/app/routes.py
index 522a7eb..9c0d274 100644
--- a/app/routes.py
+++ b/app/routes.py
@@ -41,6 +41,10 @@ def get_total_dana_by_level(level,kode):
#========================================================
# MAIN ROUTE
#========================================================
+@main.context_processor
+def inject_config():
+ return dict(api_base_url=main.config['API_BASE_URL'])
+
@main.route('/')
def index():
with get_connection() as conn:
diff --git a/templates/index.html b/templates/index.html
index bfdda74..e328a49 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -212,6 +212,7 @@
map.setMinZoom(optimalZoom);