Add new index page
This commit was merged in pull request #6.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
from fastapi import FastAPI, Path, HTTPException, status
|
||||
from fastapi.responses import RedirectResponse
|
||||
from fastapi.responses import RedirectResponse, FileResponse
|
||||
from projectorpi.cli import ProjectorSerial, ExtronSerial
|
||||
from pydantic import BaseModel
|
||||
from time import sleep
|
||||
from http import HTTPStatus
|
||||
from typing import Optional
|
||||
import sentry_sdk
|
||||
|
||||
@@ -17,6 +16,7 @@ sentry_sdk.init(
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
extron = ExtronSerial()
|
||||
projector = ProjectorSerial()
|
||||
|
||||
@@ -28,7 +28,8 @@ class Response(BaseModel):
|
||||
|
||||
@app.get("/")
|
||||
async def index() -> RedirectResponse:
|
||||
return RedirectResponse("/docs", HTTPStatus.MOVED_PERMANENTLY)
|
||||
return FileResponse("projectorpi_web/index.html")
|
||||
# return RedirectResponse("/docs", HTTPStatus.MOVED_PERMANENTLY)
|
||||
|
||||
|
||||
@app.post("/sleep", response_model=Response)
|
||||
|
||||
Reference in New Issue
Block a user