mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Working on a custom filter for base64 encoded image data.
This commit is contained in:
5
src/frontend/lib/FastAPIServer.py
vendored
5
src/frontend/lib/FastAPIServer.py
vendored
@@ -2,6 +2,7 @@
|
||||
import uvicorn
|
||||
import os
|
||||
import sass
|
||||
import base64
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.routing import APIRoute
|
||||
@@ -13,7 +14,9 @@ from ...backend.lib.config import Config
|
||||
|
||||
app = FastAPI()
|
||||
templates = Jinja2Templates(directory="src/frontend/templates")
|
||||
|
||||
def base64decode(string):
|
||||
return base64.b64decode(string).decode("utf-8")
|
||||
templates.env.filters["b64decode"] = base64decode
|
||||
|
||||
class FastAPIServer():
|
||||
"""Entry point for FastAPI server."""
|
||||
|
||||
Reference in New Issue
Block a user