Spaces:
Running
Running
File size: 541 Bytes
01923e1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """Export validated public content for the free static React deployment."""
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'backend'))
from app.content import EXAMPLE, PROJECT # noqa: E402
output = ROOT / 'frontend' / 'public' / 'api'
output.mkdir(parents=True, exist_ok=True)
for name, value in [('project', PROJECT), ('example', EXAMPLE)]:
(output / f'{name}.json').write_text(value.model_dump_json(indent=2) + '\n', encoding='utf-8')
print(f'Exported {name}.json')
|