3 Commits
Author SHA1 Message Date
traberph 896f13a448 manifest
Signed-off-by: Philipp Traber <traber.ph@gmail.com>
2025-05-01 16:07:55 +02:00
traberphandGitHub 076ad18f10 change emoji for consistency 2025-02-19 12:05:23 +01:00
traberphandGitHub da365ac881 Fix link in readme 2025-02-19 12:00:00 +01:00
6 changed files with 23 additions and 2 deletions
+1
View File
@@ -1,2 +1,3 @@
.venv
venv
__pycache__
+1 -1
View File
@@ -7,7 +7,7 @@ Because of the lack of eggs the spätzle are not sticking together and are just
Using the allergen information on the mensa website we can check if the spätzle are vegan or not and therefore can decide if one can eat them or not.
This project serves a simple [website](spaetzle.traberph.de) that checks the spätzle for you.
This project serves a simple [website](https://spaetzle.traberph.de) that checks the spätzle for you.
## How to run
Simply run it with docker compose
+9 -1
View File
@@ -1,6 +1,7 @@
from fastapi import FastAPI
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.responses import FileResponse
from fastapi.templating import Jinja2Templates
from cachetools import cached, TTLCache
from bs4 import BeautifulSoup
@@ -45,7 +46,7 @@ def checkMensa():
else:
answer = "No Spätzle today "
color = "grey"
emoji = "🤷🏻‍♂️"
emoji = "🤷"
return answer, color, emoji
@@ -56,3 +57,10 @@ async def root(request: Request):
request=request, name="main.html", context={"text": answer, "color": color , "emoji": emoji}
)
@app.get("/manifest.json")
async def manifest(request: Request):
return FileResponse(path="assets/manifest.json")
@app.get("/icons/512.png")
async def icon(request: Request):
return FileResponse(path="assets/logo.png")
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+11
View File
@@ -0,0 +1,11 @@
{
"name": "Spätzle Check",
"icons": [
{
"src": "icons/512.png",
"type": "image/png",
"sizes": "512x512"
}
]
}
+1
View File
@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="manifest" href="/manifest.json">
<title>{{text}} - {{emoji}}</title>
<style>