bilalsxadad1231231 commited on
Commit
b82f5a0
·
1 Parent(s): 850fb0b

Update backend with latest changes

Browse files
Files changed (4) hide show
  1. .env +1 -4
  2. app/core/config.py +2 -13
  3. app/main.py +0 -10
  4. env.example +2 -2
.env CHANGED
@@ -10,7 +10,4 @@ GROQ_MODEL_NAME=llama3-8b-8192
10
  # API Configuration
11
  API_V1_STR=/api/v1
12
  PROJECT_NAME=AI Todo App
13
- DEBUG=True
14
-
15
- # CORS
16
- BACKEND_CORS_ORIGINS=["http://localhost:3000", "https://yourdomain.vercel.app"]
 
10
  # API Configuration
11
  API_V1_STR=/api/v1
12
  PROJECT_NAME=AI Todo App
13
+ DEBUG=True
 
 
 
app/core/config.py CHANGED
@@ -15,19 +15,8 @@ class Settings(BaseSettings):
15
  GROQ_API_KEY: str = ""
16
  GROQ_MODEL_NAME: str = "llama3-8b-8192"
17
 
18
- # CORS
19
- BACKEND_CORS_ORIGINS: List[str] = [
20
- "http://localhost:3000",
21
- "http://127.0.0.1:3000",
22
- "http://localhost:3001",
23
- "http://localhost:5173",
24
- "http://localhost:8080",
25
- "http://localhost:4173",
26
- "http://127.0.0.1:3001",
27
- "http://127.0.0.1:5173",
28
- "http://127.0.0.1:8080",
29
- "http://127.0.0.1:4173",
30
- ]
31
 
32
  class Config:
33
  env_file = ".env"
 
15
  GROQ_API_KEY: str = ""
16
  GROQ_MODEL_NAME: str = "llama3-8b-8192"
17
 
18
+ # CORS - Not needed for Hugging Face Spaces deployment
19
+ # BACKEND_CORS_ORIGINS: List[str] = []
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  class Config:
22
  env_file = ".env"
app/main.py CHANGED
@@ -1,5 +1,4 @@
1
  from fastapi import FastAPI
2
- from fastapi.middleware.cors import CORSMiddleware
3
  from .core.config import settings
4
  from .core.database import engine, Base
5
  from .api.v1.api import api_router
@@ -14,15 +13,6 @@ app = FastAPI(
14
  debug=settings.DEBUG
15
  )
16
 
17
- # Add CORS middleware
18
- app.add_middleware(
19
- CORSMiddleware,
20
- allow_origins=settings.BACKEND_CORS_ORIGINS,
21
- allow_credentials=True,
22
- allow_methods=["*"],
23
- allow_headers=["*"],
24
- )
25
-
26
  # Include API router
27
  app.include_router(api_router, prefix=settings.API_V1_STR)
28
 
 
1
  from fastapi import FastAPI
 
2
  from .core.config import settings
3
  from .core.database import engine, Base
4
  from .api.v1.api import api_router
 
13
  debug=settings.DEBUG
14
  )
15
 
 
 
 
 
 
 
 
 
 
16
  # Include API router
17
  app.include_router(api_router, prefix=settings.API_V1_STR)
18
 
env.example CHANGED
@@ -12,5 +12,5 @@ API_V1_STR=/api/v1
12
  PROJECT_NAME=AI Todo App
13
  DEBUG=True
14
 
15
- # CORS
16
- BACKEND_CORS_ORIGINS=["http://localhost:3000", "https://yourdomain.vercel.app"]
 
12
  PROJECT_NAME=AI Todo App
13
  DEBUG=True
14
 
15
+ # CORS - Not needed for Hugging Face Spaces deployment
16
+ # BACKEND_CORS_ORIGINS=[]