mirror of
https://gitlab.com/2-chainz/2chainz.git
synced 2025-06-15 17:36:39 +00:00
Remove testing code
This commit is contained in:
parent
08c4b96918
commit
8421d7092f
@ -3,8 +3,8 @@ import time
|
||||
import tomllib
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
import logging
|
||||
from fastapi import FastAPI, Request
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
@ -13,8 +13,6 @@ app.add_middleware(
|
||||
TrustedHostMiddleware,
|
||||
allowed_hosts=["*"],
|
||||
)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
@ -31,22 +29,6 @@ def read_data() -> dict[str, str]:
|
||||
data = read_data()
|
||||
|
||||
|
||||
# Log all requests to debug issues
|
||||
@app.middleware("http")
|
||||
async def log_requests(request: Request, call_next):
|
||||
# Log what's coming in
|
||||
logger.info(f"Request: {request.method} {request.url.path}")
|
||||
logger.info(f"Host header: {request.headers.get('host')}")
|
||||
logger.info(f"CF-Ray: {request.headers.get('cf-ray', 'Not from Cloudflare')}")
|
||||
|
||||
try:
|
||||
response = await call_next(request)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.error(f"Request processing failed: {e}")
|
||||
raise
|
||||
|
||||
|
||||
@app.get("/api/")
|
||||
async def ping():
|
||||
return {
|
||||
|
@ -286,6 +286,7 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://unpkg.com/ionicons@5.0.0/dist/ionicons.js"></script>
|
||||
<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
|
||||
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user