Spaces:
Running
Running
File size: 818 Bytes
4efc280 fc61079 4efc280 b1aeb87 3887183 4efc280 5d42d17 4efc280 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
# Import the two apps
from qtAnswering.main import app as qa_app
from Summarization.main import app as sum_app
# Main app
app = FastAPI()
# Mount static folders
app.mount("/resources", StaticFiles(directory="resources"), name="resources")
app.mount("/static", StaticFiles(directory="static"), name="static")
# Mount sub-apps
app.mount("/qtAnswering", qa_app)
app.mount("/Summarization", sum_app)
# Templates
templates = Jinja2Templates(directory="templates")
# Hello page route
@app.get("/", response_class=HTMLResponse)
async def hello_page(request: Request):
return templates.TemplateResponse("hellopage.html", {"request": request})
|