Spaces:
Sleeping
Sleeping
fix: resolve parcel errors and icon issues
Browse files- Add icon.png redirect to GitHub URL in FastAPI
- Create package.json to resolve parcel errors
- Keep Tailwind CDN for proper styling
- Maintain proper module imports in app.js
- app.py +6 -1
- package.json +13 -0
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
from fastapi.responses import HTMLResponse
|
| 3 |
from fastapi.staticfiles import StaticFiles
|
| 4 |
import os
|
| 5 |
|
|
@@ -8,6 +8,11 @@ app = FastAPI()
|
|
| 8 |
# Mount static files
|
| 9 |
app.mount("/src", StaticFiles(directory="src"), name="src")
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
@app.get("/")
|
| 12 |
async def read_root():
|
| 13 |
# Read the HTML file and inject environment variables
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from fastapi.responses import HTMLResponse, RedirectResponse
|
| 3 |
from fastapi.staticfiles import StaticFiles
|
| 4 |
import os
|
| 5 |
|
|
|
|
| 8 |
# Mount static files
|
| 9 |
app.mount("/src", StaticFiles(directory="src"), name="src")
|
| 10 |
|
| 11 |
+
@app.get("/icon.png")
|
| 12 |
+
async def get_icon():
|
| 13 |
+
# Redirect to GitHub-hosted icon
|
| 14 |
+
return RedirectResponse(url="https://raw.githubusercontent.com/zmuhls/cloze-reader/main/icon.png")
|
| 15 |
+
|
| 16 |
@app.get("/")
|
| 17 |
async def read_root():
|
| 18 |
# Read the HTML file and inject environment variables
|
package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "cloze-reader-minimal",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"description": "Interactive cloze reading practice application",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"scripts": {
|
| 7 |
+
"dev": "parcel index.html",
|
| 8 |
+
"build": "parcel build index.html"
|
| 9 |
+
},
|
| 10 |
+
"devDependencies": {
|
| 11 |
+
"parcel": "^2.0.0"
|
| 12 |
+
}
|
| 13 |
+
}
|