Spaces:
Sleeping
Sleeping
Omar ID EL MOUMEN
commited on
Commit
·
9764706
1
Parent(s):
327d208
Add frontend to FastAPI
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 3 |
from contextlib import asynccontextmanager
|
| 4 |
import xml.etree.ElementTree as xmlparser
|
| 5 |
import requests
|
|
@@ -39,7 +40,7 @@ app.add_middleware(
|
|
| 39 |
|
| 40 |
@app.get("/")
|
| 41 |
async def root():
|
| 42 |
-
return
|
| 43 |
|
| 44 |
class Query(BaseModel):
|
| 45 |
keyword: str
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
+
from fastapi.responses import FileResponse
|
| 4 |
from contextlib import asynccontextmanager
|
| 5 |
import xml.etree.ElementTree as xmlparser
|
| 6 |
import requests
|
|
|
|
| 40 |
|
| 41 |
@app.get("/")
|
| 42 |
async def root():
|
| 43 |
+
return FileResponse("frontend/index.html")
|
| 44 |
|
| 45 |
class Query(BaseModel):
|
| 46 |
keyword: str
|