Skip to content

Commit 38508be

Browse files
committed
Serve the static files
1 parent 23f0a9a commit 38508be

File tree

5 files changed

+290
-0
lines changed

5 files changed

+290
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ USER nonroot
2525

2626
WORKDIR /app/dist
2727
COPY --chown=nonroot:nonroot ./src /app/dist
28+
COPY --chown=nonroot:nonroot ./static /app/dist/static
2829
COPY --chown=nonroot:nonroot --from=build /app/.venv/lib/python3.12/site-packages /app/dist
2930

3031
# in slim-bookworm: "/usr/local/bin/python3.12"

src/app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import sysconfig
1313
import sys
1414
from quart import Quart, request
15+
from quart.helpers import send_file
1516
from markupsafe import escape
1617

1718
app = Quart(__name__)
@@ -38,6 +39,18 @@ def handle_jsonp(data):
3839
async def root():
3940
return f"Running Python {platform.python_version()}", 200, { "Content-Type": "text/plain; charset=utf8;" }
4041

42+
@app.route("/favicon.ico")
43+
async def faviconIco():
44+
return await send_file("static/favicon.ico")
45+
46+
@app.route("/favicon.svg")
47+
async def faviconSvg():
48+
return await send_file("static/favicon.svg")
49+
50+
@app.route("/robots.txt")
51+
async def robotsTxt():
52+
return await send_file("static/robots.txt")
53+
4154
@app.route("/status.json")
4255
async def status_json():
4356
retVal = {}

static/favicon.ico

18.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)