feat: serve built frontend from backend with SPA fallback
This commit is contained in:
16
backend/tests/test_frontend_serving.py
Normal file
16
backend/tests/test_frontend_serving.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_unknown_path_serves_spa_index(client):
|
||||
response = await client.get("/some/client/side/route")
|
||||
assert response.status_code == 200
|
||||
assert '<div id="root">' in response.text
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_auth_routes_still_work_alongside_spa_fallback(client):
|
||||
response = await client.post(
|
||||
"/auth/register", json={"username": "frontendcheck", "password": "spookyspooky"}
|
||||
)
|
||||
assert response.status_code == 201
|
||||
Reference in New Issue
Block a user