-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (26 loc) · 825 Bytes
/
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
import logging
from logging.config import fileConfig
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from api.routers import security, tournament, stage, competitor
fileConfig('logging.conf', disable_existing_loggers=False)
logger = logging.getLogger(__name__)
app = FastAPI(
title='Tourneyman',
description='Open-source tournament management software',
version='0.0.1',
)
app.add_middleware(
CORSMiddleware,
allow_origins=[
'http://localhost:8080',
'https://localhost:8080',
],
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*'],
)
app.include_router(security.router, prefix='/auth', tags=['authentication'])
app.include_router(tournament.router)
app.include_router(stage.router)
app.include_router(competitor.router)