Skip to content

Commit 01f4542

Browse files
fixing the routes
1 parent b627892 commit 01f4542

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

main.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import groq
33
import os
44
from dotenv import load_dotenv
5-
from fastapi.middleware.cors import CORSMiddleware
6-
from topStocks import get_top_stocks
5+
76
# Load API key from .env file
87

98
load_dotenv(dotenv_path=".env")
@@ -17,13 +16,7 @@
1716

1817
app = FastAPI()
1918

20-
app.add_middleware(
21-
CORSMiddleware,
22-
allow_origins=["*"],
23-
allow_credentials=True,
24-
allow_methods=["*"],
25-
allow_headers=["*"],
26-
)
19+
2720

2821
@app.get("/ask")
2922
def ask(query: str):
@@ -45,9 +38,3 @@ def ask(query: str):
4538

4639
except Exception as e:
4740
return {"error": str(e)}
48-
49-
@app.get("/top-stocks")
50-
async def read_top_stocks():
51-
top_stocks = ['AAPL', 'GOOGL', 'MSFT', 'AMZN', 'TSLA']
52-
stock_info = get_top_stocks(top_stocks)
53-
return stock_info

0 commit comments

Comments
 (0)