Skip to content

Commit

Permalink
base files in modules
Browse files Browse the repository at this point in the history
  • Loading branch information
HMnesterov committed Aug 26, 2023
1 parent 8e59c74 commit d5b945c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/auth/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from fastapi import APIRouter

app = APIRouter()

Empty file added app/auth/dao.py
Empty file.
1 change: 1 addition & 0 deletions app/auth/deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
log
4 changes: 4 additions & 0 deletions app/telegram/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from fastapi import APIRouter

app = APIRouter()

Empty file added app/telegram/dao.py
Empty file.
1 change: 1 addition & 0 deletions app/telegram/deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
log
20 changes: 20 additions & 0 deletions core/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware

from app.telegram.app import app as telegram_app
from app.auth.app import app as auth_app
app = FastAPI()

#include routers
app.include_router(telegram_app, prefix="api")

app.include_router(auth_app)

#add protection
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
19 changes: 19 additions & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pydantic import BaseSettings


class Settings(BaseSettings):
TELEGRAM_TOKEN: str
DB_CONNECTION: str
DB_MIGRATE_PATH: str
WEBHOOK_URL: str
REDIS_CONNECTION: str
ACCESS_TOKEN_EXPIRE_MINUTES: int
SECRET_KEY: str
ALGORITM: str

class Config:
env_file = "env/.env"
encoding = "utf-8"


settings = Settings()

0 comments on commit d5b945c

Please sign in to comment.