-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
62 lines (53 loc) · 2.41 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from fastapi import FastAPI, Request
from ow_config import MAIN_URL
from api_game import router as game_router
from api_mod import router as mod_router
from api_genre import router as genre_router
from api_tag import router as tag_router
from api_resource import router as resource_router
from api_association_control import router as association_control_router
from api_association_getter import router as association_getter_router
from api_profile import router as profile_router
from api_session import router as session_router
from api_reaction import router as reaction_router
from api_black_list import router as black_list_router
from api_forum import router as forum_router
from api_forum_comment import router as forum_comment_router
app = FastAPI(
title="OpenWorkshop.Manager",
openapi_url=MAIN_URL+"/openapi.json",
contact={
"name": "Contacts",
"url": "https://github.com/Open-Workshop/open-workshop-manager",
"email": "miskler@yandex.ru"
},
license_info={
"name": "MPL-2.0 license",
"identifier": "MPL-2.0",
},
description="""
OpenWorkshop.Manager - это оркестратор "сервисного монолита" OpenWorkshop. Через него выполняются все операции чтения/записи каталога.
Оркестратор имеет зависимые микросервисы: MySQL *(заблокирован для использования вне оркестратора)*, Storage *(файловый сервер к которому можно обращаться напрямую)*.
""",
redoc_url=MAIN_URL+"/",
docs_url=MAIN_URL+"/docs"
)
@app.middleware("http")
async def modify_header(request: Request, call_next):
response = await call_next(request)
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Expose-Headers"] = "Content-Type,Content-Disposition"
return response
app.include_router(game_router)
app.include_router(mod_router)
app.include_router(genre_router)
app.include_router(tag_router)
app.include_router(resource_router)
app.include_router(association_control_router)
app.include_router(association_getter_router)
app.include_router(profile_router)
app.include_router(session_router)
app.include_router(reaction_router)
app.include_router(black_list_router)
app.include_router(forum_router)
app.include_router(forum_comment_router)