fix: favicon and some stuff
This commit is contained in:
+8
-5
@@ -3,11 +3,10 @@ import requests
|
||||
from typing import Annotated
|
||||
from fastapi import FastAPI, Header, HTTPException
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.responses import FileResponse
|
||||
from pydantic import BaseModel
|
||||
from . import myice
|
||||
|
||||
|
||||
origins = ["*"]
|
||||
|
||||
app = FastAPI()
|
||||
@@ -33,10 +32,14 @@ class AuthHeaders(BaseModel):
|
||||
return False
|
||||
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
@app.get("/")
|
||||
async def home():
|
||||
with open("index.html") as f:
|
||||
return f.read()
|
||||
return FileResponse("index.html")
|
||||
|
||||
|
||||
@app.get("/favicon.ico")
|
||||
async def favico():
|
||||
return FileResponse("favicon.ico")
|
||||
|
||||
|
||||
@app.get("/schedule")
|
||||
|
||||
Reference in New Issue
Block a user