Change web framework to Starlette, db versioning to alembic #93

Closed
Hay1tsme wants to merge 32 commits from starlette_cleanup into master
Showing only changes of commit 7b49a8ab58 - Show all commits

View File

@ -1,4 +1,5 @@
from typing import Dict, List, Tuple
from typing import Dict, List, Tuple, Any
import json
import logging, coloredlogs
from logging.handlers import TimedRotatingFileHandler
from starlette.requests import Request
@ -9,6 +10,15 @@ from core.config import CoreConfig
from core.data import Data
from core.utils import Utils
class JSONResponseNoASCII(Response):
media_type = "application/json"
def render(self, content: Any) -> bytes:
return json.dumps(
content,
ensure_ascii=False,
).encode("utf-8")
class BaseServlet:
def __init__(self, core_cfg: CoreConfig, cfg_dir: str) -> None:
self.core_cfg = core_cfg