Skip to content

Commit

Permalink
Merge branch 'develop' into merge-2024-1-eps-mds
Browse files Browse the repository at this point in the history
  • Loading branch information
victorleaoo authored Sep 5, 2024
2 parents 9aaaf36 + 69a8064 commit ebf4ec7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ venv
.env
env
/enviroments
#
#
.vercel
6 changes: 6 additions & 0 deletions index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import uvicorn


if __name__ == '__main__': # pragma: no cover
port = 8002
uvicorn.run('src.main:app', reload=True, port=int(port), host="0.0.0.0")
3 changes: 0 additions & 3 deletions src/controller/pautaController.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from dotenv import load_dotenv
from fastapi_mail import ConnectionConfig, FastMail, MessageSchema, MessageType
from ..domain.models.pautaSchema import EmailSchema
from starlette.responses import JSONResponse
Expand All @@ -9,8 +8,6 @@
prefix="/pauta"
)

load_dotenv()

MAIL_USERNAME=os.getenv("MAIL_USERNAME")
MAIL_PASSWORD=os.getenv("MAIL_PASSWORD")
MAIL_FROM=os.getenv("MAIL_FROM")
Expand Down
18 changes: 9 additions & 9 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List
from fastapi.middleware.cors import CORSMiddleware
from fastapi import BackgroundTasks, FastAPI
from fastapi import FastAPI


from src.controller import pautaController
import sys
import uvicorn
# import sys


app = FastAPI()
Expand All @@ -24,9 +24,9 @@
def read_root():
return {"message": "UnB-TV!"}

if __name__ == '__main__':
port = 8080
if (len(sys.argv) == 2):
port = sys.argv[1]
# if __name__ == '__main__':
# port = 8080
# if (len(sys.argv) == 2):
# port = sys.argv[1]

uvicorn.run('main:app', reload=True, port=int(port), host="0.0.0.0")
uvicorn.run('main:app', reload=True, port=int(port), host="0.0.0.0")
15 changes: 15 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"builds": [
{
"src": "src/main.py",
"use": "@vercel/python",
"config": {"maxLambdaSize": "15mb"}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "src/main.py"
}
]
}

0 comments on commit ebf4ec7

Please sign in to comment.