Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Commit

Permalink
feat: static folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dantetemplar committed Nov 23, 2024
1 parent d6c9f36 commit e289f4c
Show file tree
Hide file tree
Showing 190 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!/pyproject.toml
!/poetry.lock
!logging.yaml
!/static/

# And ignore cache files in the code
__pycache__
1 change: 0 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ __pycache__
### Environment ###
.env
settings.yaml
static

### Sensible ###
/private.pem
Expand Down
4 changes: 4 additions & 0 deletions backend/src/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from fastapi.routing import APIRoute
from fastapi_swagger import patch_fastapi
from starlette.middleware.cors import CORSMiddleware
from starlette.staticfiles import StaticFiles

import src.logging_ # noqa: F401
from src.api.lifespan import lifespan
Expand Down Expand Up @@ -75,6 +76,9 @@ def generate_unique_operation_id(route: APIRoute) -> str:
domain=None,
)

app.mount(settings.static_mount_path, StaticFiles(directory=settings.static_directory), name="static")


from src.modules.events.routes import router as router_events # noqa: E402
from src.modules.notifies.routes import router as router_notify # noqa: E402
from src.modules.sports.routes import router as router_sports # noqa: E402
Expand Down
4 changes: 4 additions & 0 deletions backend/src/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class Settings(SettingBaseModel):
"Allowed origins for CORS: from which domains requests to the API are allowed. Specify as a regex: `https://.*.innohassle.ru`"
session_secret_key: SecretStr
"Secret key for session middleware"
static_mount_path: str = "/static"
"Path to mount static files"
static_directory: Path = Path("static")
"Path to the directory with static files"

@classmethod
def from_yaml(cls, path: Path) -> "Settings":
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/айкидо.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/альпинизм.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/армрестлинг.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/бадминтон.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/баскетбол.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/бейсбол.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/биатлон.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/бобслей.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/бодибилдинг.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/бокс.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/боулинг.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/брейкинг.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/водное_поло.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/static/волейбол.png
Binary file added backend/static/гандбол.png
Binary file added backend/static/гиревой_спорт.png
Binary file added backend/static/го.png
Binary file added backend/static/гольф.png
Binary file added backend/static/гребной_слалом.png
Binary file added backend/static/гребной_спорт.png
Binary file added backend/static/дартс.png
Binary file added backend/static/джиу-джитсу.png
Binary file added backend/static/дзюдо.png
Binary file added backend/static/ездовой_спорт.png
Binary file added backend/static/зимнее_плавание.png
Binary file added backend/static/каратэ.png
Binary file added backend/static/кёрлинг.png
Binary file added backend/static/кендо.png
Binary file added backend/static/керешу.png
Binary file added backend/static/кикбоксинг.png
Binary file added backend/static/киокусинкай.png
Binary file added backend/static/киокушин.png
Binary file added backend/static/конный_спорт.png
Binary file added backend/static/корэш.png
Binary file added backend/static/кудо.png
Binary file added backend/static/лапта.png
Binary file added backend/static/легкая_атлетика.png
Binary file added backend/static/лыжные_гонки.png
Binary file added backend/static/мас-рестлинг.png
Binary file added backend/static/микрофутзал.png
Binary file added backend/static/муайтай.png
Binary file added backend/static/нарды.png
Binary file added backend/static/падел.png
Binary file added backend/static/парусный_спорт.png
Binary file added backend/static/пауэрлифтинг.png
Binary file added backend/static/пилонный_спорт.png
Binary file added backend/static/плавание.png
Binary file added backend/static/полиатлон.png
Binary file added backend/static/прыжки_в_воду.png
Binary file added backend/static/прыжки_на_батуте.png
Binary file added backend/static/пэйнтбол.png
Binary file added backend/static/радиоспорт.png
Binary file added backend/static/рафтинг.png
Binary file added backend/static/регби.png
Binary file added backend/static/роллер_спорт.png
Binary file added backend/static/сават.png
Binary file added backend/static/самбо.png
Binary file added backend/static/санный_спорт.png
Binary file added backend/static/серфинг.png
Binary file added backend/static/скалолазание.png
Binary file added backend/static/сквош.png
Binary file added backend/static/скейтбординг.png
Binary file added backend/static/сноуборд.png
Binary file added backend/static/софтбол.png
Binary file added backend/static/спорт_глухих.png
Binary file added backend/static/спорт_слепых.png
Binary file added backend/static/страйкбол.png
Binary file added backend/static/сумо.png
Binary file added backend/static/таврели.png
Binary file added backend/static/теннис.png
Binary file added backend/static/триатлон.png
Binary file added backend/static/тхэквондо.png
Binary file added backend/static/тхэквондо_гтф.png
Binary file added backend/static/тхэквондо_итф.png
Binary file added backend/static/тхэквондо_мфт.png
Binary file added backend/static/ушу.png
Binary file added backend/static/фехтование.png
Binary file added backend/static/фитнес-аэробика.png
Binary file added backend/static/флорбол.png
Binary file added backend/static/фристайл.png
Binary file added backend/static/футбол.png
Binary file added backend/static/хапкидо.png
Binary file added backend/static/хапсагай.png
Binary file added backend/static/хоккей.png
Binary file added backend/static/хоккей_с_мячом.png
Binary file added backend/static/хуреш.png
Binary file added backend/static/чир_спорт.png
Binary file added backend/static/шахматы.png
Binary file added backend/static/шашки.png
Binary file added backend/static/шодсанлат.png

0 comments on commit e289f4c

Please sign in to comment.