add files
This commit is contained in:
parent
e4d947ca0a
commit
49ef4e52d6
|
@ -0,0 +1,9 @@
|
|||
import os
|
||||
|
||||
CODE_DIR = os.path.dirname(__file__)
|
||||
ROOT_DIR = os.path.dirname(CODE_DIR)
|
||||
DATA_DIR = os.path.join(ROOT_DIR, "data")
|
||||
|
||||
QDRANT_URL = os.environ.get("QDRANT_URL", "http://localhost:6333")
|
||||
QDRANT_API_KEY = os.environ.get("QDRANT_API_KEY")
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import os
|
||||
|
||||
from fastapi import FastAPI
|
||||
from starlette.staticfiles import StaticFiles
|
||||
|
||||
from code_search.config import ROOT_DIR
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/api/search")
|
||||
async def search(query: str):
|
||||
return {
|
||||
"result": query
|
||||
}
|
||||
|
||||
app.mount("/", StaticFiles(directory=os.path.join(ROOT_DIR, 'frontend', 'dist', 'spa'), html=True))
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
Loading…
Reference in New Issue