mirror of
https://gitlab.com/2-chainz/2chainz.git
synced 2025-06-15 17:36:39 +00:00
Make API work with cloudflare
This commit is contained in:
parent
b5f8dae3b9
commit
3a1c7a904c
@ -6,7 +6,7 @@ from unittest.mock import patch
|
||||
from two_chainz import app
|
||||
import two_chainz
|
||||
|
||||
client = TestClient(app)
|
||||
client = TestClient(app, base_url="http://chainz.ansonbiggs.com")
|
||||
|
||||
|
||||
class TestApi:
|
||||
|
@ -5,8 +5,14 @@ from fastapi.staticfiles import StaticFiles
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
import random
|
||||
from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
app.add_middleware(
|
||||
TrustedHostMiddleware, allowed_hosts=["ansonbiggs.com", "*.ansonbiggs.com"]
|
||||
)
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user