This commit is contained in:
mstfyldz
2026-03-06 20:10:48 +03:00
parent ebf42796e3
commit 52029d49ab

View File

@@ -4,8 +4,7 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler): class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self): def do_GET(self):
# Kök dizin (/) veya /islamic.json isteklerinde JSON dönüyoruz if self.path == '/islamic.json':
if self.path in ['/', '/islamic.json', '/api']:
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json; charset=utf-8') self.send_header('Content-Type', 'application/json; charset=utf-8')
# CORS ayarları (Uygulamalardan sorunsuz erişim için) # CORS ayarları (Uygulamalardan sorunsuz erişim için)
@@ -21,6 +20,11 @@ class RequestHandler(BaseHTTPRequestHandler):
except Exception as e: except Exception as e:
error_res = json.dumps({"error": "Config file not found or readable.", "details": str(e)}) error_res = json.dumps({"error": "Config file not found or readable.", "details": str(e)})
self.wfile.write(error_res.encode('utf-8')) self.wfile.write(error_res.encode('utf-8'))
elif self.path == '/':
self.send_response(200)
self.send_header('Content-Type', 'text/plain; charset=utf-8')
self.end_headers()
self.wfile.write(b"")
else: else:
self.send_response(404) self.send_response(404)
self.send_header('Content-Type', 'application/json; charset=utf-8') self.send_header('Content-Type', 'application/json; charset=utf-8')