mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 08:20:02 +02:00
custom.css endpoint defaults to empty Response now
This commit is contained in:
parent
8310a51a74
commit
386e69b048
@ -6,7 +6,7 @@ from typing import Any
|
||||
|
||||
import socketio # type: ignore[import-untyped]
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from fastapi import FastAPI, Response
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
@ -171,12 +171,13 @@ class WebServer:
|
||||
return self.web_settings
|
||||
|
||||
# exposing custom.css file provided by user
|
||||
if self.css is not None:
|
||||
|
||||
@app.get("/custom.css")
|
||||
async def styles() -> FileResponse:
|
||||
@app.get("/custom.css")
|
||||
async def styles() -> Response:
|
||||
if self.css is not None:
|
||||
return FileResponse(str(self.css))
|
||||
|
||||
return Response(content="", media_type="text/css")
|
||||
|
||||
app.mount(
|
||||
"/",
|
||||
StaticFiles(
|
||||
|
Loading…
x
Reference in New Issue
Block a user