-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add index.html to api, fix virtualio.
- Loading branch information
Showing
4 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
import logging | ||
from pathlib import Path | ||
|
||
from fastapi import APIRouter | ||
from fastapi.responses import FileResponse | ||
|
||
logger = logging.getLogger(__name__) | ||
static_router = APIRouter( | ||
tags=["static"], | ||
) | ||
|
||
|
||
# @static_router.get("/") | ||
# def index(): | ||
# """ | ||
# return homepage of booth | ||
# """ | ||
# headers = {"Cache-Control": "no-store, no-cache, must-revalidate"} | ||
# return FileResponse(path=Path(__file__).parent.parent.joinpath("web_spa", "index.html").resolve(), headers=headers) | ||
|
||
|
||
# @static_router.get("/private.css") | ||
# def ui_private_css(): | ||
# """ | ||
# if private.css exists return the file content, otherwise send empty response to avoid 404 | ||
# """ | ||
# path = Path("userdata", "private.css") | ||
# headers = {"Cache-Control": "no-store, no-cache, must-revalidate"} | ||
# if not path.is_file(): | ||
# return Response("/* placeholder. create private.css in userdata folder to customize css */", headers=headers) | ||
# else: | ||
# return FileResponse(path=path, headers=headers) | ||
@static_router.get("/") | ||
def index(): | ||
""" | ||
return homepage of booth, index is special not cached so spa updates are less a problem | ||
""" | ||
headers = {"Cache-Control": "no-store, no-cache, must-revalidate"} | ||
return FileResponse(path=Path(__file__).parent.parent.joinpath("web_spa", "index.html").resolve(), headers=headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Photobooth-App</title> | ||
<meta charset=utf-8> | ||
<meta name=description content="wigglecam-api frontend"> | ||
<meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"> | ||
<meta name=mobile-web-app-capable content=yes> | ||
<meta name=apple-mobile-web-app-capable content=yes> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>Wigglecam-Api Frontend</h1> | ||
<p>The api is just a backend with no actual frontend. This is just a collection of links, that might be helpful:</p> | ||
<ul> | ||
<li><a href="/api/doc">API docs</a></li> | ||
<li><a href="/api/acquisition/stream.mjpg">Nodes Livestream</a></li> | ||
|
||
</ul> | ||
</div> | ||
</body></html> |