Created
January 12, 2022 11:34
-
-
Save tazarov/eec9fc8f2ffa8a22a1cf48d94f7b7281 to your computer and use it in GitHub Desktop.
FastAPI with React App
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
import logging | |
from fastapi import FastAPI | |
from starlette.responses import RedirectResponse | |
from starlette.staticfiles import StaticFiles | |
app = FastAPI() | |
@app.get("/") | |
async def index(): | |
return RedirectResponse(url="/index.html") | |
app.mount("/", StaticFiles(directory="backend/ui/"), name="ui") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment