Skip to content

Commit

Permalink
MR for dev branch.
Browse files Browse the repository at this point in the history
Feat: settings files for vscode and debugger on vscode.
  • Loading branch information
alexiusstrauss authored Nov 27, 2023
2 parents 0d3643d + 62fb796 commit c31a638
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 102 deletions.
1 change: 1 addition & 0 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ chromadb = "*"
python-multipart = "*"
speechrecognition = "*"
pydub = "*"
pylint = "*"

[dev-packages]

Expand Down
237 changes: 143 additions & 94 deletions backend/Pipfile.lock

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions backend/src/api.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from fastapi import FastAPI, File, UploadFile
from fastapi.middleware.cors import CORSMiddleware

from .exceptions import FileFormatException
from .models import UploadResponse
from .services import DeepDive
from .services.exceptions import FileFormatException
from .services.models import UploadResponse
from .services.services import DeepDive
from .settings.development import CORS_CONFIG

app = FastAPI()

# Configuração do middleware CORS

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
allow_origins=CORS_CONFIG["allow_origins"],
allow_credentials=CORS_CONFIG["allow_credentials"],
allow_methods=CORS_CONFIG["allow_methods"],
allow_headers=CORS_CONFIG["allow_headers"],
)


Expand Down
4 changes: 4 additions & 0 deletions backend/src/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import uvicorn

if __name__ == "__main__":
uvicorn.run("src.api:app", host="0.0.0.0", port=8000, reload=True)
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions backend/src/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# settings.py

CORS_CONFIG = {
"allow_origins": ["*"],
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
}
Empty file.
8 changes: 8 additions & 0 deletions backend/src/settings/development.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Settings development mode

CORS_CONFIG = {
"allow_origins": ["*"],
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
}

0 comments on commit c31a638

Please sign in to comment.