This commit is contained in:
mstfyldz
2026-03-06 20:08:47 +03:00
parent 18a96a0154
commit ebf42796e3
3 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ FROM python:3.11-alpine
WORKDIR /app
# JSON dosyasını ve Python sunucusu betiğini kopyala
COPY config.json server.py ./
COPY islamic.json server.py ./
# 80 portunu dışarı aç (Coolify varsayılanı)
EXPOSE 80

View File

@@ -4,8 +4,8 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
# Kök dizin (/) veya /config.json isteklerinde JSON dönüyoruz
if self.path in ['/', '/config.json', '/api']:
# Kök dizin (/) veya /islamic.json isteklerinde JSON dönüyoruz
if self.path in ['/', '/islamic.json', '/api']:
self.send_response(200)
self.send_header('Content-Type', 'application/json; charset=utf-8')
# CORS ayarları (Uygulamalardan sorunsuz erişim için)
@@ -15,7 +15,7 @@ class RequestHandler(BaseHTTPRequestHandler):
self.end_headers()
try:
with open('config.json', 'r', encoding='utf-8') as f:
with open('islamic.json', 'r', encoding='utf-8') as f:
content = f.read()
self.wfile.write(content.encode('utf-8'))
except Exception as e: