Patel aryan commited on
Commit
b6e5a27
·
1 Parent(s): 72e420a

refactor: remove unused import for populate_db and adjust main execution block

Browse files
Files changed (1) hide show
  1. backend/app/main.py +5 -2
backend/app/main.py CHANGED
@@ -1,10 +1,9 @@
 
1
  from fastapi import FastAPI
2
  from fastapi.middleware.cors import CORSMiddleware
3
  from backend.app.routes import search_route
4
  import logging
5
 
6
- from backend.app.scripts.populate_db import populate_db
7
-
8
  # Initialize FastAPI app
9
  app = FastAPI(title="LeetCode Vector Search API", version="1.0")
10
 
@@ -35,3 +34,7 @@ app.include_router(search_route.router, prefix="/api", tags=["Search"])
35
 
36
  # run initial population of the database only once then only run scraping
37
  # populate_db()
 
 
 
 
 
1
+ import uvicorn
2
  from fastapi import FastAPI
3
  from fastapi.middleware.cors import CORSMiddleware
4
  from backend.app.routes import search_route
5
  import logging
6
 
 
 
7
  # Initialize FastAPI app
8
  app = FastAPI(title="LeetCode Vector Search API", version="1.0")
9
 
 
34
 
35
  # run initial population of the database only once then only run scraping
36
  # populate_db()
37
+
38
+ if __name__ == "__main__":
39
+ uvicorn.run("backend.app.main:app", host="0.0.0.0",
40
+ port=7860, reload=False)